Home

See the related posts

Mysql server version using php function – mysql_get_server_info()    Text file prompt download or force download using php    Number of lines in a file using php    Check Image exists or Not Using php and GD    PHP Warning: Call-time pass-by-reference has been deprecated   

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;
}
?>

Home

See the related posts

Mysql server version using php function – mysql_get_server_info()    Text file prompt download or force download using php    Number of lines in a file using php    Check Image exists or Not Using php and GD    PHP Warning: Call-time pass-by-reference has been deprecated   

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment