File modification time on PHP<5
Moderator: General Moderators
File modification time on PHP<5
Hello,
I can't find a way to check remote file modification time in PHP4.
cause filemtime (stat,fstat) works on local files only, and there is
no get_headers function. I appraciate any ideas, thx.
I can't find a way to check remote file modification time in PHP4.
cause filemtime (stat,fstat) works on local files only, and there is
no get_headers function. I appraciate any ideas, thx.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
That's OK. the problem is: i want to minimize the transfer by checkingLast-Modified is an optional header response.
if the file was modified before the download, if there is no information
i can download it and check localy (most of the files i deal with has the
info )
Is there no more simple way to check the header in php?, i can't believe,Fsockopen and curl are often used to request a remote page to fetch the headers returned.
but thanks anyway. (curl could be useful for other things i do)
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Does this help?
Code: Select all
echo date('F d Y H:i:s', filemtime(__FILE__));Code: Select all
$url = 'http://devnetwork.net';
$LastModified = getLastModifiedTime($url);
echo $LastModified;