PHP Tutorials: Swear Word Filter (Part 1)

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
7,844
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, 2 dislikes

Link to this comment:

Share to:

Uploader Comments (phpacademy)

  • "Bloody" isn't mild to 2% of people: 2% consider it strong. Neither is it a swearword, according to 22%. Advertising research also found that, when two versions of an advertisement were shown to two groups, one using "bloody", the other using "bl**dy", slightly more people from the group that saw the asterisked version objected than the number from the group who saw the word. So the asterisked version is 'officially' worse and I therefore challenge the reasoning behind the filter

  • I didn't create this filter so people could filter the word bloody, I used it as an example as I have younger audience too,

Top Comments

  • Website1643 (5 months ago)

    is trolling ignore him....

see all

All Comments (23)

Sign In or Sign Up now to post a comment!
  • Thanks

  • Alex: "If shit is found"

    PHP: "I've found tons"

  • Thanks a lot Alex. I used this technique to convert text emoticons into image tags with the appropriate image for my guestbook and blog. Keep up the awesome work!

  • @phpacademy As I always said, You are rock ! pls keep it up man.

  • @phpacademy As I always said, you are rock man. please keep it up

  • #LOL

  • The video player turned black when I had my filter on!

    That's not swearing, That's Racism!

  • Replaced Bloody with blood. Shit with spill.

    I don't give a blood spill!

  • the problem with this swear filter is that it will filter out words from the array that appear within other words. For example if you design your filter to replace "Cock" with "Cockerel" then the word peacock will be changed to "peacockerel", which obviously is not the desired effect. There must be a way to replace only whole words.

  • Another GREAT tutorial, i use the example to replace smiles with images.

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