PHP interferes with lastModified function

I have found a useful script at which shows the date a page was last modified. I have put it at where it works perfectly. But the same script with a PHP file extension as here only shows the current time. There is no PHP in the page, but somehow the PHP processor seems to be upsetting it.

Are you using PHP’s header command to tell PHP to write a Last Modified header? If you want it to reflect the time the file was updated, you’ll have to write the header in PHP itself to retrieve that time from the file information and write it into the header.