note 40551 added to function.is-int
| From: | php-general at lists dot php dot net | Date: | Sun, 07 Mar 2004 18:44:31 +0000 |
| Subject: | note 40551 added to function.is-int | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66401@lists.php.net to get a copy of this message | ||
You can also use is_int() for form input if you want to check wether the variable is an integer or
not. Just do like this:
<?
if (is_int($form_input+0) {
echo "This is an integer";
} else {
echo "This is not an integer.";
}
?>
The "+0" converts the string to an integer, so is_int() can be used.
----
Manual Page -- http://www.php.net/manual/en/function.is-int.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40551
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40551&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40551&report=yes
Search -- http://master.php.net/manage/user-notes.php