note 80312 deleted from function.preg-replace by bjori
| From: | bjori@php.net | Date: | Wed, 09 Jan 2008 17:34:00 +0000 |
| Subject: | note 80312 deleted from function.preg-replace by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134976@lists.php.net to get a copy of this message | ||
Note Submitter: zack at custom-ds dot com
----
To parse out non-numeric characters, use the following replace statement. This is helpful in
validating what is supposed to be purely numeric data before storing or running calculations.
$strNumeric = preg_replace('/[^0-9]/', '', $strAlphaNumeric);