Keef on 04/28/09
Last Edited at 04/28/09 01:48pm
function download($url, $cache_time=0){ $cache_file = sys_get_temp_dir(). '/'. sha1($url); if (file_exists($cache_file) && (time() - @filemtime($cache_file) < $cache_time)) { $file = file_get_contents($cache_file); } else { $file = file_get_contents($url); file_put_contents($cache_file, $file); } return $file;}
Report this snippet Tweet
Comment:
You need to login to post a comment.