Porl123 Posted September 25, 2008 Share Posted September 25, 2008 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 More sharing options...
Push Eject Posted September 25, 2008 Share Posted September 25, 2008 use str_ireplace() instead Link to comment https://forums.phpfreaks.com/topic/125813-solved-word-omittion/#findComment-650540 Share on other sites More sharing options...
Porl123 Posted September 25, 2008 Author Share Posted September 25, 2008 Sweet! Thanks man, I owe you one Link to comment https://forums.phpfreaks.com/topic/125813-solved-word-omittion/#findComment-650545 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.