Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "http://imgur.com/a/LKe3L");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
- $result = curl_exec($ch);
- $result = preg_replace("/[\n\r\t]/","",$result);
- preg_match_all("#//(i\.imgur\.com/[a-zA-Z0-9]+?\.jpg)#", $result, $tempMatch);
- foreach($tempMatch[1] as $val)
- {
- $url = "http://".$val;
- echo $url."\r\n";
- file_put_contents("./image/".preg_replace("@/@", "-",$val), file_get_contents($url));
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement