First of all, this kind of functionality will be browser specific. I have been using website (browsercam dot com), which offers this kind of services for testing cross-browser compatibility against IE/Firefox/Opera/Safari etc... And i have seen really funny looking screenshots with interesting error messages. And thoses error messages will reveal some specifics about implementation of that website. It seems, like there are multiple computers with different opsystems and/or browsers online 24/7 and all the screen capturing is done with real browsers. And seems, that this is not very reliable method (it will give many, many errors). But it seems to be best at this time. Now, if you want some simple method, like only Internet Explorer based screenshots, then you can use Windows based server and Apache/PHP. Then write some simple C/C++/Delphi based command line utility to execute IE and make screenshots. Or find similar ready-to-use freeware/shareware utils. Now use PHP system() function to pass data to command line utility. Thats all ... Another choice - Linux server/Apache/PHP and Mozilla browser. Of course, i suggest to be very paranoid about potential security issues with new exploits popping up every day :)
Viewing a page is a client-side operation. PHP doesn't really have any idea what a page looks like, because it doesn't render it and it can't force a client to display it.
AFAIK the sites like browsercam and the one that show in Safari all have to bring the page up on an actual client and then do an actual screen capture. I'm not sure what language the brograms are written in, but I think it's safe to say it's not PHP.