/ Published in: PHP
Make it $newstring = eregreplace("[^A-Za-z0-9]", "", $string );
Expand |
Embed | Plain Text
$string = "(032)555-5555"; echo $new_string;
Comments
Subscribe to comments
You need to login to post a comment.

try replacing the second line with the following:
$newstring = pregreplace('[\D]', '', $string);
It is slightly shorter, and a bit faster.