This will tell you what res your user has. Write it to a db or text file. I found my site that I checked by far most people were on 1024x768.
<?
if(isset($HTTP_COOKIE_VARS["users_resolution"]))
$screen_resolution = $HTTP_COOKIE_VARS["users_resolution"];
else //means cookie is not found set it using Javascript
{
?>
<script language="javascript">
<!--
writeCookie();
function writeCookie()
{
var today = new Date();
var the_date = new Date("December 31, 2010");
var the_cookie_date = the_date.toGMTString();
var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height;
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie=the_cookie
}
//-->
</script>
<?
}
?>
You could use something like this to write to a text file. This wouldn't prevent the many duplicates you would get and a db would be better.
$REMOTE_ADDR = getenv('REMOTE_ADDR');
$date = date('m-d-Y, H:i',mktime());
$fp = fopen ("screenres.txt","a");
$screen_size = $REMOTE_ADDR."\t".$date."\t".$screen_resolution."\n";
fwrite ($fp, $screen_size);
fclose ($fp);