Location: PHPKode > scripts > Spam Filter > spam-filter/spamfilterTest.php
<?
//------------------------------------------------------------------------------------------
// SpamFilter Test
//------------------------------------------------------------------------------------------
include('spamfilter.php');
$sf = new SpamFilter();

$text = 'get lots of xxx pictures in your e-mail!';
if (!$sf->filter($text)) {
	echo "'$text' is normal!<br />";
	$sf->movefrom($text,NORMAL);
}
else echo "'$text' is spam =)!<br />";

$text = 'Your account information';
if ($sf->filter($text)) {
	echo "'$text' is spam!<br />";
	$sf->movefrom($text,SPAM);
}
else echo "'$text' is normal =)!<br />";

$text = 'Get free xxx account passwords!';
if (!$sf->filter($text)) {
	echo "'$text' is normal!<br />";
	$sf->movefrom($text,NORMAL);
}
else echo "'$text' is spam =)!<br />";

$text = 'Hello, my friend!';
if ($sf->filter($text)) {
	echo "'$text' is spam!<br />";
	$sf->movefrom($text,SPAM);
}
else echo "'$text' is normal =)!<br />";

$text = 'orkut - john has written in your scrap book';
if ($sf->filter($text)) {
	echo "'$text' is spam!<br />";
	$sf->movefrom($text,SPAM);
}
else echo "'$text' is normal =)!<br />";

$text = 'orkut - mary has written in your scrap book';
if ($sf->filter($text)) {
	echo "'$text' is spam!<br />";
	$sf->movefrom($text,SPAM);
}
else echo "'$text' is normal =)!<br />";

echo '<pre>';
var_dump($sf->data);
echo '</pre>';
?>
Return current item: Spam Filter