Jump to content

Archived

This topic is now archived and is closed to further replies.

king arthur

Getting date script was last modified

Recommended Posts

I have a piece of javascript on one of my pages which displays the date the page was last modified, the important bit is:

[code]dateUpdated = new Date(document.lastModified);[/code]

I want to replace this with PHP but I haven't as yet come across a function that can get me the date the current script, or any arbitrary file, was last modified. Is there one? Is there a superglobal that has the info I want?

Share this post


Link to post
Share on other sites
You can do it like so...
[code]$updated = date("F d Y H:i:s.", getlastmod());[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.