Hi,
I'm trying to censor words, but not other words containing the censored words. Here's an example of my script:
$word = "butt";
$message = "butt armbutt butt butter butterfly butt.";
$message = eregi_replace(trim($word), str_repeat("*", strlen($word)), $message);
echo $message;
I only want to replace the word "butt" but not the portions of words that contain the string "butt". I don't want to but spaces around the $word string because if "butt" is the first or last word in the phrase, it won't be replaced. Any suggestions?