I don't know how to do this in pure PHP. Maybe it's impossible at all, since PHP runs on server-side, but the screen resolution is only available at client-side.
So one way of doing this could be with the help of javascript and the address line:
test.html:
<script language="javascript">
url = "test.php?w=" + screen.width + "&h=" + screen.height;
location = url;
</script>
test.php:
<?
$scr_x = $HTTP_GET_VARS["w"];
$scr_y = $HTTP_GET_VARS["h"];
?>
greetings,
Michael aka Unique