/ Published in: PHP
Here is a set of functions that can be very useful: Give this script the url of a webpage, and it will save all images from this page on your server.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function getImages($html) { $regex = '~http://somedomain.com/images/(.*?)\.jpg~i'; foreach ($matches[1] as $img) { saveImg($img); } } function saveImg($name) { $url = 'http://somedomain.com/images/'.$name.'.jpg'; $data = get_data($url); } $i = 1; $l = 101; while ($i < $l) { $html = get_data('http://somedomain.com/id/'.$i.'/'); getImages($html); $i += 1; }