This is for a chat page. I have a $string = \"This dude is a mothertrucker\". I have an array of badwords: $bads = array(\'truck\', \'shot\', etc)
$string = \"This dude is a mothertrucker\"
$bads = array(\'truck\', \'shot\', etc)
function contains($str, array $arr) { foreach($arr as $a) { if (stripos($str,$a) !== false) return true; } return false; }