Hi,
I have a question is there a way in php to check the last
modified date from a remote file, not a local file on the server.
For example: http://www.maraex.com/index2.php3
This is how the function looks like, but when i call this function, this function returns only a date when you give a url without the filename.
For example if you give the url (www.maraex.com) the function returns a date, if you set a filename the server won't return anything.
<?
function get_httpfile_date($httpfile)
{
$fp = fsockopen ("$httpfile", 80, $errno, $errstr, 30);
@fputs ($fp, "GET / HTTP/1.0\r\n\r\n");
for ($count=0; $count<8; $count++)
{
@$string = fgets ($fp,128);
$header = "$header|$string";
}
$header_array = split("Last-Modified:",$header);
$header_array = split("|",$header_array[1]);
$datum = $header_array[0];
@fclose ($fp);
return($datum);
}
$datum = get_httpfile_date("http://www.maraex.com/index2.php3");
echo $datum;
?>
Can anybody help me with this code so it worked with a remote filename.
Thanks for your time.