Jump to content

[SOLVED] Word omittion


Porl123

Recommended Posts

I want certain words on my site (entered on user's profiles) to be blocked, such as racist words. I've been able to so far, create a table in my db listing the offensive phrases, then using a while loop to check the user's quote and then a str_replare to replace the offensive word to 'phrase omitted', which does work, but it doesn't take into account the casing of the letters. Does anyone know a way to make it ignore casing?

 

Here's what I have so far -

 

$query = mysql_query("SELECT * FROM `blocked_phrases`");

while($row = mysql_fetch_array($query)) {

$string = str_replace($row[key_phrase],"<span style=\"color: red\">phrase omitted</span>", $string);

}

 

Any help will be much appreciated! :) thanks

Link to comment
https://forums.phpfreaks.com/topic/125813-solved-word-omittion/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.