Following is my piece of code in which I am assigning my screen width to variable $width. But when I convert it to integer and echo it, 0 is returned.
$width = '<script> document.write(window.screen.width); </script>';
//if i echo $width it shows 1366 which is width of my screen
$height = '<script> document.write(window.screen.height); </script>';
echo "The height is = $height"."<br>The width is = ".$width;
$a = (int)($width);
echo $a;
I am asking for guidenance to make this conversion perfect.
$width, which when cast to an integer is 0.:P.