Link is: /example.php?id=1
, no space after 1
.
if (isset($_GET["id"])) {
$id = $_GET["id"];
echo !is_int($_GET["id"]); // yields "1" (true) !!!
}
Ask me whatever you need.
I check to make sure that my system didn't go crazy !is_int(1)
yields false. So... I don't know...
Maybe $_GET
passes "1"
instead of 1
. But how do I cast integer in PHP, when it's all handled in background?
Edit: string(1) "1"
, yep, string. How can I check $_GET["id"]
as integer against is_int()
?