> From: "Chris Boget" <chris.boget@xxxxxxxx> > Is there a way to replace/remove *whole* words from a > phrase? For example: [snip] > $stringToParse = str_replace( $exceptionPhrase, '', trim( > $stringToParse )); Try this instead of str_replace() $stringToParse = preg_replace("/(^|\\W){$exceptionPhrase}(\\W|$)/i",'\\1',$stringToParse); ---John Holmes... UCCASS - PHP Survey System http://www.bigredspark.com/survey.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php