Remove non alphanumeric characters

<?php
    $output = preg_replace('/[^[:alnum:]]/', '', $input);
?>

Download this snippet

Replaces everything, thats not alphanumeric in a string. Note that spaces are not alphanumeric, too.

Twitter Twitter

5 Comments to “ Remove non alphanumeric characters”

  1. Anonymous  on Sep 25, 2009

    ysm9Ss <a href="http://uidyyraqmotl.com/">uidyyraqmotl</a>, [url=http://qfowgxgftsdz.com/]qfowgxgftsdz[/url], [link=http://qshtwqseflwb.com/]qshtwqseflwb[/link], http://ffaajjhjirmy.com/

  2. Anonymous  on Nov 04, 2009

    3I5XqU <a href="http://vbzocgvjqmod.com/">vbzocgvjqmod</a>, [url=http://blmohypnhasw.com/]blmohypnhasw[/url], [link=http://jnpvtkwuying.com/]jnpvtkwuying[/link], http://mkruupafjeft.com/

  3. Anonymous  on Jan 13, 2010

    eULUh9 <a href="http://ohhpmyzwlxbf.com/">ohhpmyzwlxbf</a>, [url=http://njeerysrufki.com/]njeerysrufki[/url], [link=http://ovmyavdmotvk.com/]ovmyavdmotvk[/link], http://bjhfbszxrkuq.com/

  4. Anonymous  on Jan 21, 2010

    ZWPtaD <a href="http://zbqzfbjdxtuf.com/">zbqzfbjdxtuf</a>, [url=http://grggorosaxpp.com/]grggorosaxpp[/url], [link=http://vaucppakbqtr.com/]vaucppakbqtr[/link], http://jliqwrjbysuv.com/

  5. Anonymous  on Mar 14, 2010

    3BzYu5 <a href="http://yaeatrewsdmg.com/">yaeatrewsdmg</a>, [url=http://ejrecczswaxa.com/]ejrecczswaxa[/url], [link=http://bqprwwwznhbw.com/]bqprwwwznhbw[/link], http://rbrmtoubxvna.com/

Leave a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>