note 10465 added to is_int
| From: | jm at clininfo dot fr | Date: | Fri, 05 Jan 2001 12:54:02 +0000 |
| Subject: | note 10465 added to is_int | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-9402@lists.php.net to get a copy of this message | ||
is_numeric is the correct function to test if a string containts a number, for example after a POST.
is_int tests if the variable itself is an integer.
If the variable is not set, either is_int or is_numeric is false. We can test it first with isset.
http://www.php.net/manual/function.is-int.php