I am trying to make sure the GET string is set in the URL and that it’s value is an integer, but I can’t get this to work.
if (isset($_GET['allusers']) && is_int($_GET['allusers'])) {
echo "works";
}
Am I doing something wrong with my parentheses?
A
$_GETvariable can’t be an integer. It’ll always be a string.To test is it’s a numeric string, use
is_numeric():