note 24425 deleted from function.floatval by didou
| From: | didou@php.net | Date: | Sun, 18 May 2003 10:03:50 +0000 |
| Subject: | note 24425 deleted from function.floatval by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-48484@lists.php.net to get a copy of this message | ||
Note Submitter: nik@orfanos.org
----
In case you are not running PHP 4.2+ you can use this function:
function floatval( $strValue )
{
$floatValue = preg_replace( "/[^0-9\.]*/", "", $strValue );
return $floatValue;
}
It's very simple, but it works and it should help someone. Enjoy.