is string numeric
| From: | Harold | Date: | Thu, 16 Mar 2000 10:16:41 +0000 |
| Subject: | is string numeric | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-12222@lists.php.net to get a copy of this message | ||
i didnt find this function in the manual.. in coldfusion there is a
isnumeric function which returns true or false if a string only contains
numbers.. i think this would be a nice function to include in php? :)
there is currently a gettype function .. with this i get
$a = "12345";
echo gettype($a); // displays "string"
$b = 12345;
echo gettype($b); // displays "integer"
is_numeric could work this way
$a = "12345"; // or $a = 12345;
echo is_numeric($a); // true
$b = "12345a";
echo is_numeric($b); // false
intval is not what im after here..
if there is already a function that does this, can you point me to the
location of it in the manual..
thanks
Harald