Code: Select all
$communication=$_POST['communication'];
$communication = stripslashes(preg_replace('#^(.*?)((\d{4}[ -]{0,1})(\d{4}[ -]{0,1})(\d{4}[ -]{0,1})(\d{4}[ -]{0,1}))(.*)$#', '${1}************${6}${7}', preg_quote($communication)));
$words = array('bad1','bad2', bad3');
$commfixed = str_ireplace($words,'**removed**',$communication);The code above will do it and put a **removed** in its place, but I want to be able to STOP the email in its tracks. And potentially redirect them to the form telling them to "mind their language".
Am having trouble finding out how to say if $words is in $commfixed then to REDIRECT. I know the redirect code, just cannot grasp how to do it the moment it find a word.
Help??