-
-
Save ScottPhillips/3065208 to your computer and use it in GitHub Desktop.
| <?php | |
| function cache_image($image_url){ | |
| //replace with your cache directory | |
| $image_path = 'path/to/cache/dir/'; | |
| //get the name of the file | |
| $exploded_image_url = explode("/",$image_url); | |
| $image_filename = end($exploded_image_url); | |
| $exploded_image_filename = explode(".",$image_filename); | |
| $extension = end($exploded_image_filename); | |
| //make sure its an image | |
| if($extension == "gif" || $extension == "jpg" || $extension == "jpeg" || $extension == "png") { | |
| //get the remote image | |
| $image_to_fetch = file_get_contents($image_url); | |
| //save it | |
| $local_image_file = fopen($image_path.$image_filename, 'w+'); | |
| chmod($image_path.$image_filename,0755); | |
| fwrite($local_image_file, $image_to_fetch); | |
| fclose($local_image_file); | |
| } | |
| } | |
| //usage | |
| //cache_image(“http://www.flickr.com/someimage.jpg”); |
Thanks for your sharing. However, my account image for uno online always occurs error and it does not appear. I don't know why.
basketball stars stands out in part because of its focus on skill. Because winning demands timing, strategy, and accuracy, every game feels competitive and satisfying.
Thanks Scott, works nicely.
This article on Rgarrpto was actually helpful. I liked how you covered the key points without overcomplicating things. Keep posting content like this. Rgarrpto
The tone used on Ameisenhardt is professional yet friendly. Language remains simple and easy to follow. This makes content accessible to a wider audience. Ameisenhardt avoids long and confusing sentences. Clear communication improves learning speed. Readers enjoy spending more time on the site. This helps build long-term loyalty.
Travel forums and lifestyle blogs often benefit from guides that highlight destinations with clarity and detail. For readers interested in exploring unique places, uncuymaza provides insights into attractions worth visiting. The guide is designed to inform and inspire, offering perspectives that connect culture, adventure, and everyday travel experiences. It’s a strong complement for anyone planning journeys and looking for thoughtful guidance.
Thank you but how do we specify the number of days it should be cached ?