Jump to content

Bad Langauage filter


Steppio

Recommended Posts

I've been building a website lately that will have alot of comments from users coming across and was just wondering if anybody has ever heard of a bad/undesirable language filter/template that i could read up on and possibly manipulate into my own webpage. If you've ever heard of anything like this i would be more than grateful if you could help me out. Thanks in advance.

 

Steppio.

Link to comment
https://forums.phpfreaks.com/topic/91316-bad-langauage-filter/
Share on other sites

check out php.net/preg_replace

 

<?php
   $badWords = array("/poo/","/fart/","/stinkyhead/","/etc/");
   
   $string = "here is my poo text string of stinkyhead words";
   
   $string = preg_replace($badWords,'bleep',$string);   

echo $string; // returns: here is my bleep text string of bleep words 
?>

Link to comment
https://forums.phpfreaks.com/topic/91316-bad-langauage-filter/#findComment-467979
Share on other sites

aebstract - if you look at my original message you'll see i didn't ask for any code, i asked if anyone had seen or had any information that could help me. I tried searching for 'PHP Bad Language filter'/'PHP Undesirable Language Filter' which both came up with nothing. I asked for help and phpSensei gave it to me, you gave me sarcasm and a bad attitude. If you feel the need to insult peoples intelligence everytime they ask for help, maybe help forums aren't for you. Thanks to everybody else

Link to comment
https://forums.phpfreaks.com/topic/91316-bad-langauage-filter/#findComment-468279
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.