note 10136 modified in function.intval by philip
| From: | philip@php.net | Date: | Wed, 26 Mar 2003 00:31:16 +0000 |
| Subject: | note 10136 modified in function.intval by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-45818@lists.php.net to get a copy of this message | ||
[Editor's Note: Or just use is_numeric() or ctype_digit()]
intval() is usefull to see if a var is a number or a letter.
$test1 = "11";
$test2 = "RT";
intval($test1) returns 11
intval($test2) returns 0
So, except if your number is 0, a 0 will mean it's a letter...
--was--
[Editor's Note: Or just use is_int()! ;) --zak@php.net]
intval() is usefull to see if a var is a number or a letter.
$test1 = "11";
$test2 = "RT";
intval($test1) returns 11
intval($test2) returns 0
So, except if your number is 0, a 0 will mean it's a letter...
http://www.php.net/manual/en/function.intval.php