PHP doesn't know about the user's screen resolution, but you can of course use Javascript to detect it. Something like the following, for instance?
<script type="text/javascript">
function setImageSrcBasedOnResolution()
{
document.getElementById("myImage").src="dynamicResolutionImage.php?size="
+ window.screen.width + "x" + window.screen.height;
}
</script>
<body onLoad="setImageSrcBasedOnResolution()">
<img id="myImage" src="temporaryLoadingImage.png" />
</body>
Where dynamicResolutionImage.php is some script that generates an image with the given size.