PHP Tutorials: Swear Word Filter (Part 2)

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
4,779
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 21, 2009

Filter out your chosen array of words for multi-use using this handy function!

Official website
http://phpacademy.org

Support Forum
http://phpacademy.org/forum

Follow us on Twitter!
http://twitter.com/phpacademy

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (phpacademy)

  • yo m8 if you include in your guestbook wouldnt the box cum up?

  • You can make it so the new string is put into a variable and just stored for use in the guestbook.

  • You know, you could just:

    str_replace("shit","sh**",$str­ing);

    =)

  • but it makes it easier to keep EVERY word you want to filter in an array :)

Top Comments

  • thnx

  • Good tuts ;)

see all

All Comments (13)

Sign In or Sign Up now to post a comment!
  • So if I type sh*t on youtube, I can make it say **CENSORED** on youtube?

  • it sais Notice: Undefined index: submit in .../index.php on line 11

  • Hey, it gives an error on the line where this is:

    if ($_post['submit'])

    do you know why?

  • hi how can i include swearfilter from my forum. please i really need your help our capstone project final defense is fast approaching. thanks.

  • Could it also be done in a database and add all the words into the database

  • look up the replace documentation, a user submitted script allows associative array transformation.

    'shit' => 's***t'

    also you can use regular expressions to grab the text inbetween the first and last letters and replace it with * :)

  • Cheeeeeeeers Alex for this nice tut!

  • Cheeeeeers Alex for this clever tut!

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more