I would like to get the last modified date of a remote file by means of curl. Does anyone know how to do that?
would something like this work, from web developer forum
<? $last_modified = filemtime("content.php"); print("Last Updated - ");
print(date("m/d/y", $last_modified)); ?
// OR
$last_modified = filemtime(__FILE__);
the link provides some useful insite on you can use them
Had to solve similiar issue, but for me download once a day was enough so I compared just the modify day of the local (downloaded) cache file. The remote file had no Last-Modified header.
$xml = 'test.xml';
if (is_file($xml) || date('d', filemtime($xml)) != date('d')) {
$xml = file_get_contents(REMOTE_URL);
}