I would like to get the last modified date of a remote file by means of curl. Does anyone know how to do that?
By editing h4kuna's answer I created this:
$fileURL='http://www.yahoo.com';
$headers = get_headers($fileURL, 1);
$date = "Error";
//echo ""; print_r($headers); echo "
";
if ( $headers && (strpos($headers[0],'200') !== FALSE) ) {
$time=strtotime($headers['Last-Modified']);
$date=date("d-m-Y H:i:s", $time);
}
echo 'file: '.$fileURL.' (Last-Modified: '.$date.')
';