Is someone can explain me this..:
$bob = $_POST['foo'] ;
is_int($bob) FAIL but is_numeric($bob) is OK .
So i know i cannot use is_int directly on $_POST but here i transfert the post value in another variable before..
Whats wrong please ?!
Is someone can explain me this..:
$bob = $_POST['foo'] ;
is_int($bob) FAIL but is_numeric($bob) is OK .
So i know i cannot use is_int directly on $_POST but here i transfert the post value in another variable before..
Whats wrong please ?!
Copyright © 2021 Jogjafile Inc.
$_POSTvalues are strings, no matter whether they contain a numeric value or not. Just transferring them to a different variable doesn't change that.You'd have to typecast the variable:
but note that non-integer values are cast to
0in this case.