trying to get window width on server side
$w = "<script>document.write(screen.width);</script>";
echo $w;  // 1600
echo '<br>' . gettype($w); // string
now I need an integer instead the string
tried a lot of ways from here
for example
$w = intval($w);  
$w = (int) $w; 
settype($w, "integer"); 
echo $w;  // 0
echo '<br>' . gettype($w);  // integer  
so result is allways 0 and integer
how to explain - php sees the variable but cannot handle with it ?
and how can I get 1600-integer
