Remove all characters except numbers and letters from a string in PHP
Friday, September 21st, 2007<?php
$string = ‘your string’;
$new_string = ereg_replace( ‘[^A-Za-z0-9]‘, ”, $string);
echo $new_string;
?>
<?php
$string = ‘your string’;
$new_string = ereg_replace( ‘[^A-Za-z0-9]‘, ”, $string);
echo $new_string;
?>