Doing it yourself isn't worth the bother -- there are web services you can use like
Thumboo! and
WebThumb. They usually offer a REST API and provide drop-in PHP code for your page. That saves you the bother of finding or creating a web browser that's implemented in PHP or monkeying with font metrics in the PHP image processor or ImageMajik.
For other alternatives, search for "PHP website thumbnail API" (without the quotes).