PHP/File Directory/filemtime

Материал из Web эксперт
Перейти к: навигация, поиск

discover the modification date of a file with the function filemtime()

   <source lang="html4strict">

<? $mtime = filemtime( "test.txt" ); print "test.txt was last modified on "; print date("D d M Y g:i A", $mtime); ?>

 </source>
   
  


filemtime.php

   <source lang="html4strict">

<?php

  $file = "data.txt";
  echo "File last updated: ".date("m-d-y  g:i:sa", filemtime($file));

?>

 </source>
   
  


Getting file timestamps

   <source lang="html4strict">

<?php $last_access = fileatime("l.php"); $last_modification = filemtime("m.php"); $last_change = filectime("c.php"); ?>

 </source>