Advertisement
Nexo78

Untitled

Nov 2nd, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. function get_img($imgs, $thumbs, $preview){
  2.  
  3.     $ch = curl_init($imgs);
  4.     curl_setopt($ch, CURLOPT_HEADER, 0);
  5.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  6.     curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
  7.     $raw = curl_exec($ch);
  8.     curl_close($ch);
  9.  
  10.     foreach ($thumbs as $thumb){
  11.         $saveto1 = $thumb;
  12.         $fp = fopen($saveto1, 'w');
  13.         fwrite($fp, $raw);
  14.         fclose($fp);
  15.     }
  16.  
  17.     foreach ($preview as $prev){
  18.         $saveto2 = $prev;
  19.         $fp2 = fopen($saveto2, 'w');
  20.         fwrite($fp2, $raw);
  21.         fclose($fp2);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement