Jump to content

[SOLVED] Str_Replace help?


darklight

Recommended Posts

I'm trying to replace a word but it replaces all the words.  I'm basically trying to block bad words.  Yes, I did ask for help about this before but still never found out how to do it  :P.

 

$Bad = array('fuck','shit','porn',
             'pussy','cock','dick',
		 'sex','nigger','cunt',
		 'ass','drblock','dr-block',
		 'sucks','suck','crap',
		 'pron','anal','cornhole',
		 'butthole','asshole','tit');

$request = ucwords(strip_tags(str_replace($_POST['textfield3'],'$Bad','panda')));

Link to comment
https://forums.phpfreaks.com/topic/68891-solved-str_replace-help/
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.