/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function cache_image($image_url){ //replace with your cache directory $image_path = 'path/to/cache/dir/'; //get the name of the file //make sure its an image if($extension=="gif"||$extension=="jpg"||$extension=="png"){ //get the remote image //save it } } //usage //cache_image("http://www.flickr.com/someimage.jpg");