note 18168 added to function.intval
| From: | some at gamepoint dot net | Date: | Sat, 12 Jan 2002 20:33:02 +0000 |
| Subject: | note 18168 added to function.intval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-24754@lists.php.net to get a copy of this message | ||
If you wish to is_int() so called values from a form or in general this would mean numbers in
strings, you can just do the following
[code]
$nr = "203";
if(is_int($nr+0))
echo "is integer";
else
echo "is not integer";
[/code]
The $nr+0 will convert the string to a real numerical value in order to add 0 to it.
--
http://www.php.net/manual/en/function.intval.php
http://master.php.net/manage/user-notes.php?action=edit+18168
http://master.php.net/manage/user-notes.php?action=delete+18168
http://master.php.net/manage/user-notes.php?action=reject+18168