August, 13, 2004 archives
generating a last-modified time from php
while the getlastmod()
function can tell you when the main file was last modified, it would be cool if php kept track of the most recent last modification time of all included files, assuming that it is already doing a stat()
on each file as it includes it.
the value may not always be directly applicable (sometimes you are pulling in other data, or database information), but it would be useful. i guess you would want another function to inject possible timestamps into the mix.
the alternative is to iterate over the results of get_included_files() and stat()
all of them.
or i guess you could just live with getlastmod()
, and ignore the fact that it isn’t accurate when you do something like change the header that you’re including via some other mechanism.