I have a very simple question: what is the best way to download a file in PHP but only if a local version has been downloaded more than 5 minute ago?
In my actual ca
You would warp it into a cache like method:
function getFile($name) { // code stolen from @Peter M if ($file exists) { if ($file time stamp older than 5 minutes) { $file = file_get_contents($url) } } else { $file = file_get_contents($url) } return $file; }