php spam filter class
This is a simple but powerful php spam filter code.
Just go through the function and the description. The spam keywords can be given as case insensitive. it will match al possible combinations to avoid sapce and other combinations of case.
<?php
// spam words filter by samplephpcodes.com
//$exclude_words ==> is the arrya contain spam keywors
//$message ==> contains the message need to be cheked
// output returned the list of spam words if it founds
// output will return "NULL" if no span content found
function filter_words($exclude_words,$message){
$output="NULL";
foreach ($exclude_words as $word) {
if (!stristr($message, $word) === FALSE){
$output=$output."[". $word.']';
}
}
return $output;
}
?>




