Re: is_numeric

From: Date: Wed, 04 May 2005 13:31:01 +0000
Subject: Re: is_numeric
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-214425@lists.php.net to get a copy of this message
pete M wrote:
not a php expert but have filed this bug report re validating is_numeric('3e0'); http://bugs.php.net/bug.php?id=32943
Yeah I read that report... and as it says you're using Euler's notation.
Now tried function isnumeric($n) { if (ereg("^[0-9]{1,50}.?[0-9]{0,50}$", $n)) {
if (preg_match('/^[0-9]+\.?[0-9]+$/'), $n) {
     return true;
} else {
     return false;
} } and that doent seem to work either.. any ideas.. need to validate anything without 0-9 and a dot within tia Pete


« previous php.general (#214425) next »