Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. <?php
  2. $url = 'http://oceanseven.in/O7/xx/';
  3. $fgc = file_get_contents($url);
  4. if(preg_match_all('/<a\s+href=["\']([^"\']+)["\']/i', $fgc, $links, PREG_PATTERN_ORDER)) {
  5.     $all_hrefs = array_unique($links[1]);
  6.     if(!empty($all_hrefs)) {
  7.         $num = 1;
  8.         foreach($all_hrefs as $v_href) {
  9.             if($num <= 10) {
  10.                 if(strpos($v_href, '.jpg') !== false) {
  11.                     file_put_contents($v_href, file_get_contents($url . '/' . $v_href));
  12.                 }
  13.             }
  14.             $num++;
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement