note 100647 added to function.is-int
| From: | Anonymous at osu1 dot php dot net | Date: | Thu, 28 Oct 2010 04:22:05 +0000 |
| Subject: | note 100647 added to function.is-int | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-173538@lists.php.net to get a copy of this message | ||
had the same problem as
dtp at rodanmedia dot net
04-Jan-2010 06:30
found answer:
run it this way:
<?php
if (is_int($search+0)) {echo "Say something nice.";
}else{
echo "Oops! You're no mathematician!";}
?>
is_int() has more benifits for checking GETs or POSTs then is_numeric() (for example input
$search=3,5 may result an error in your code with is_numeric(), but with is_int(+0) will not
----
Server IP: 69.147.83.197
Probable Submitter: 178.34.44.72
----
Manual Page -- http://www.php.net/manual/en/function.is-int.php
Edit -- https://master.php.net/note/edit/100647
Del: integrated -- https://master.php.net/note/delete/100647/integrated
Del: useless -- https://master.php.net/note/delete/100647/useless
Del: bad code -- https://master.php.net/note/delete/100647/bad+code
Del: spam -- https://master.php.net/note/delete/100647/spam
Del: non-english -- https://master.php.net/note/delete/100647/non-english
Del: in docs -- https://master.php.net/note/delete/100647/in+docs
Del: other reasons-- https://master.php.net/note/delete/100647
Reject -- https://master.php.net/note/reject/100647
Search -- https://master.php.net/manage/user-notes.php