note 25864 added to function.is-numeric

From: Date: Wed, 09 Oct 2002 10:58:55 +0000
Subject: note 25864 added to function.is-numeric
Groups: php.notes 
Request: Send a blank email to php-notes+get-37837@lists.php.net to get a copy of this message
This small functions should do the trick, but doesn't handle exponentials. (You should be able to figure out the exp part easily.) function str_is_numeric($var) { if ($var+1 != 1 || $var == "0") { return true; } else { return false; } } -- http://www.php.net/manual/en/function.is-numeric.php http://master.php.net/manage/user-notes.php?action=edit+25864 http://master.php.net/manage/user-notes.php?action=delete+25864 http://master.php.net/manage/user-notes.php?action=reject+25864

« previous php.notes (#37837) next »