Disemvoweling PHP Function

Disemvoweling is a technique used on blogs and forums to censor any post or comment that contains spam or other unwanted text. It involves simply removing the vowels from the text so that it is almost, but not entirely, unreadable.

Use the following function to disemvowel a string of text.

function disemvowel($string)
{
    return str_replace(array('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'), '', $string);
}

As an example, the first sentence on this post:

Disemvoweling is a technique used on blogs and forums to censor any post or comment that contains spam or other unwanted text.

would appear like this:

Dsmvwlng s tchnq sd n blgs nd frms t cnsr ny pst r cmmnt tht cntns spm r thr nwntd txt.

Which doesn't make a lot of sense, but is still kind of readable. This technique kills unwanted comments without removing the text entirely.

Check out the Wikipedia page on Disemvoweling for more information on the origins or this method.

Comments

Never seen this before, but is very interesting
Permalink

how do u disemvowel someone's comment like say facebook. It's a perfect argument ender.

Permalink
Nice tool. Wonder if it would make sense to only apply the replacement to words that are larger than 3 characters.
Permalink

Amazing Article! I would like to thank you for the efforts you made in writing this awesome article. This article inspired me to read more. Keep it up.

Permalink

Add new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
9 + 10 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.