Jump to content

[PHP] Replace


Mudsaf

Recommended Posts

I have code like below and i'm wondering how to replace the array if its same even if its the word is written like tHiS.

$censorword =  str_replace(<PHP_ARRAY>[<CENSORWORD ARRAY>], "*****" , <CONTENT>);

I tried

$censorword =  str_replace(strtolower(<PHP_ARRAY>[<CENSORWORD ARRAY>]), "*****" , strtolower(<CONTENT>)); 

But the $censorword whole string is lowercase after that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...