SyntaxFix
Write A Post
Hire A Developer
Questions
Simplest way to truly remove all non-numeric characters:
echo preg_replace('/\D/', '', $string);
\D represents "any character that is not a decimal digit"
\D
http://php.net/manual/en/regexp.reference.escape.php