note 1534 deleted from ereg_replace by philip
| From: | philip@php.net | Date: | Mon, 27 Aug 2001 12:41:48 +0000 |
| Subject: | note 1534 deleted from ereg_replace by philip | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17199@lists.php.net to get a copy of this message | ||
If you want to strip out any extra characters in a string before using it as a number (ie, turn $4,
096.22 into 4096.22) you can use this:
$String = ereg_replace("[^([:digit:][=.=])]", "", $String);
There is probably a better way to do it, but it works.