Page 1 of 1

timestamp

Posted: Tue Feb 28, 2006 4:28 pm
by vietboy505
This script show the time of the file last modify. So every PHP I write, I have to replace file.php to something else.
Is there possible way of not doing of not doing this?

Code: Select all

<br><br>
<?php
$last_modified = filemtime("file.php");
print("Last Modified: ");
print(date("M-j-Y h:i:s", $last_modified));
?>

Posted: Tue Feb 28, 2006 4:43 pm
by feyd

Code: Select all

<?php

function lastModified()
{
  list($data) = debug_backtrace();
  $out = '';
  if (isset($data['file']))
  {
    $out .= 'Last Modified: ' . date('Y-m-d H:i:s', filemtime($data['file']));
  }
  return $out;
}

?>
maybe

Posted: Tue Feb 28, 2006 8:23 pm
by vietboy505
that work!

thx