Return to Snippet

Revision: 26430
at April 28, 2010 04:18 by Wardy


Initial Code
$string = "remove ever^&thing but *&^*&%£ letters & numbers*&^*";
$cleansedstring = ereg_replace("[^A-Za-z0-9]", "", $string );
echo $cleansedstring;

Initial URL
http://www.brightcherry.co.uk/scribbles/2008/07/15/php-remove-everything-but-letters-and-numbers-reg-expressions/

Initial Description

                                

Initial Title
PHP: Remove Everything But Letters And Numbers – Reg Expressions

Initial Tags
php, text

Initial Language
PHP