PHP/File Directory/filemtime

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

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

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



filemtime.php

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



Getting file timestamps

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