This will not work at all. There is no origin of content to replace from and no variable to actually echo. This would be more correct. This will be a chatbox example.
<?php$shout=strip_tags($_POST['shout']);$shouts=str_replace("curse","replace",$shouts);//Repeat each word//mysql query?>
That would be the correct form. Your example will simply provide an error. If it were to work it would still display the curse word due to no variable being stored.
I think the $shout variable should be $shout and not $shouts as the parameter to the str_replace function.
Php Word Filter Have you accidently sworn on your site? Or do you want to keep visitor
in General Discussion
Posted · Report reply
I think the $shout variable should be $shout and not $shouts as the parameter to the str_replace function.