note 21234 deleted from function.is-int by didou
| From: | didou@php.net | Date: | Sun, 18 May 2003 10:15:30 +0000 |
| Subject: | note 21234 deleted from function.is-int by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-48497@lists.php.net to get a copy of this message | ||
Note Submitter: sandino@sandino.net
----
[Ed. note: is_int() checks whether the type of the variable is an int, not the contents. If you want
to check the contents, you can use is_numeric(). ]
[Ed. note:
There is also a whole set of ctype functions which many of you might find useful:
http://www.php.net/manual/en/ref.ctype.php
]
is_int() does not work when passing strings.
This one does:
function str_is_int($str) {
$var=intval($str);
return ($str==$var);
}