note 100647 deleted from function.is-int by danbrown

From: Date: Thu, 28 Oct 2010 04:49:07 +0000
Subject: note 100647 deleted from function.is-int by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-173539@lists.php.net to get a copy of this message
Note Submitter: Anonymous ---- 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

« previous php.notes (#173539) next »