note 95397 deleted from function.is-numeric by danbrown
| From: | danbrown@php.net | Date: | Thu, 31 Dec 2009 16:37:42 +0000 |
| Subject: | note 95397 deleted from function.is-numeric by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-164497@lists.php.net to get a copy of this message | ||
Note Submitter: jotun dot k at gmail dot com
----
I was looking for a way to see check to see if a variable is just a simple positive rational number
without exponential notation or a sign. This is what I came up with.
if (is_numeric($input)){
if (is_int((int)$input))
$isNumber = true;
else
$isNumber = false;
}
else{
$isNumber = false;
}