Jump to content

[SOLVED] Language filter.


xyn

Recommended Posts

Yo.
right here's the scenario, basically I wanted to enter all 'bad words'
into my database ONCE, in LOWERCASE (done) but how can i SET
the field to LOWERCASE, Replace all nescassary fields, then remove
the LOWERCASE?

My code
function FilterWords($w1)
{
  $sql = mysql_query("SELECT * FROM filter");
  $words = array();
  $replace = array();
  while ($x = mysql_fetch_array($sql))
  {
$words[] = $x['badword'];
$replace[] = $x['replace'];
  }

$return = str_replace($words, $replace, $w1);
return $return;
}

used as... FilterWords($_POST[field]);
Link to comment
https://forums.phpfreaks.com/topic/28676-solved-language-filter/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.