tags:

views:

111

answers:

3
+2  A: 

You can use filemtime() to get the modification time for a file.

Amber
A: 

If you want to get timestamp of the last modification of the current file you can use code below:

<?php
    $stat = (stat(__FILE__));
    echo 'Document last updated: ', date('M d Y', $stat['mtime']);
?>
Sergey Kuznetsov
i don't want the current file. I want the modified time for the cache file.
Jacob Relkin
A: 

Why not use one of the php cacheing options out there? PHP Accelerator or PHP:APC? These provide a ready rolled solution for what you want.

Toby Allen
APC doesn't cache output, it caches bytecode, which is then executed. APC's default behavior wouldn't reduce database load, which is what he requested. You *could* use APC's user key store to store output yourself, but frankly, that's not really APC's strength.
Frank Farmer