Advertisement
ShawnsSpace

file_put_contents

Jul 2nd, 2016
148
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 = 'https://external.xx.fbcdn.net/safe_image.php?d=AQAxiUtD3ARM7k63&url=http%3A%2F%2Fs.ndimg.de%2Fimage_gallery%2Fnew_netdoktor%2F09%2Ffotolia-63049294-drubig-photo-fotolia-com-800_id_81735_257409.jpg';
  3. //note will rename image after transfer, dir must exist.
  4. $img = 'images/facebook/YourImageName.jpg';
  5. // allow_url_fopen = on "must be on in php.ini or php5.ini"
  6. file_put_contents($img, file_get_contents($url));
  7. echo '<img src="'.$img.'" />';
  8. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement