Zend - The PHP Company




Files and Directories

Add Code


Last edited file in a dir script.  

Type: code fragment
Added by: inter
Entered: 13/07/2000
Last modified: 08/12/1999
Rating: - (fewer than 3 votes)
Views: 6077
Show's the last edited file in a directory


<?php
 $basedir
="DIR";
  
$handle=opendir($basedir); 
  
$temp="";
  while(
$file readdir($handle))
  {
     if(
filemtime($file)<=filemtime($temp))
     {
       
$temp=$file;
     }
  }
  
closedir($handle);
  echo 
"<A HREF="DIR/".$temp."">";
  echo 
"LAST EDITED</A><BR>n";
?>


Usage Example




Rate This Script





Search



This Category All Categories