function number_check($int){
if($int>0 && !is_float($int)){return TRUE;}
else{return FALSE;}
}
$var="025";
if(number_check($var)){echo "pass";}else{echo "fail";}
I have make a function to check the number for post id.
post_id
should always > 0
and no decimal.
but I have a problem when user try to enter 000243
, if user put zero
at front, it return true
.
Is any way to solve this?