PHP
$width = "<script>var windowWidth = screen.width; document.write(windowWidth); </script>";
$height = "<script>var windowHeight = screen.height; document.write(windowHeight); </script>";
if ($width >= 1680) {
return "OK";
}
else {
return "NOK";
}
Returning result for $width is 1920, I can see that if I push it's value to the client-side. But it's not numeric nor string. Whatever conditional check I tried, couldn't make the calculation.
I mean;
$width == 1920 // false
intval($width) == 1920 // false (returns 0 as $width value)
(int)$width == 1920 // false (same with float)
$width == "1920" // false
How can I process that $width value for conditional checks properly?