Anyone know how to verify if a variable is a whole positive number (no decimal points)?
You could use
if ($i%1) { // if whole integer } else { //not whole integer }
I think.....
I think you'd better use:
if(intval($i)== floatval($i)) { //If your value IS an int } else { //NOT an int }
Nota : intval($x) returns the integer part of $x
Well, you could try gettype() http://www.php.net/manual/en/function.gettype.php though more reliable would be is_int() http://www.php.net/manual/en/function.is-int.php
yep i was just about to post the old RTFM for
is_int()
boy the manual sure is handy