If you are getting it out out a db, Make a function called profanityFilter($text) { } and then inside it, do a foreach($text as $value) { } and then get from a db like while($row=mysql_fetch_array($query)) { } and inside that do: str_ireplace($row['badword'], $row['replacewith'], $value); Then it will be done.. An example is shown below:
PHP:
<?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);
}
}
?>
That may not be exactly right.. but it will get you on the right tracks.