For example: there is a list of links, next to the link is a picture. How to make so that this picture was a screen from the site to which the link leads?

  • one
    Not so long ago, I was also interested in this question. Join us - Vitaly Kustov

1 answer 1

Hey. To get a screenshot of the site, you can use the free service http://mini.sshot.com/. An example of using this:

function screen($url, $extn, $size, $format) { $url = 'http://mini.s-shot.ru/'.$extn.'/'.$size.'/'.$format.'/?'.urlencode($url); $str = file_get_contents($url); file_put_contents('screen.'.$format, $str); // тут лучше указать путь куда сохранять } screen('http://hashcode.ru', '1024x768', '600', 'jpeg'); 

The function using the service creates a screenshot of the site and saves it to the file "screen.jpeg". Then you can load it with <img ...>