

<?php
// profanity filter
public function profanityFilter($text) {
$query = mysql_query("SELECT * FROM `wordfilter`")or die(mysql_error());
while($row = mysql_fetch_array($query)) {
str_ireplace($row['badword'], $row['replacewith'], $text);
}
}
?>
<?php
function filter($text) {
$badwords = array('one' => '***', 'two' => '***', 'three' => '*****');
str_ireplace($badwords[0], $badwords[1], $text);}
}
?>

