Thursday, August 4, 2011

PHP string replace all except numbers and chars

Here is PHP function(code) to remove all but not characters and numbers.
$result= preg_replace("/[^a-zA-Z0-9]+/", "", $text);
p.s. If you are looking to delete everything but numbers, than look here:
http://pilotaz.blogspot.com/2011/05/php-remove-all-characters-and-leave_29.html

No comments:

Post a Comment