I have a value from $_GET
, and I want it to be integer.
$val = "123";
is_integer($val); // false
is_numeric($val); // true
How do I check if it's of type int?
Do I really have to use regex, or multiply it by 1 and try is_integer then?
I have a value from $_GET
, and I want it to be integer.
$val = "123";
is_integer($val); // false
is_numeric($val); // true
How do I check if it's of type int?
Do I really have to use regex, or multiply it by 1 and try is_integer then?