Return to Snippet

Revision: 58558
at July 20, 2012 22:17 by satie83


Initial Code
$strNumeric = preg_replace('/\D/', '', $strNonNumeric);

Initial URL
http://www.crainbandy.com/programming/function-to-remove-all-non-numeric-characters-in-php

Initial Description
Sometimes it’s helpful to ONLY get numeric characters.
Phone numbers, age — whatever your little PHP heart desires.

Initial Title
PHP - Remove all non-numeric characters

Initial Tags
php

Initial Language
PHP