note 14154 added to function.filemtime.php

From: Date: Thu, 19 Jul 2001 01:24:54 +0000
Subject: note 14154 added to function.filemtime.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-15559@lists.php.net to get a copy of this message
To list files by last modified try out this code--- chdir("{directory}"); $dir = opendir("."); while($file=readdir($dir)){ if(!eregi("^(.|..)$",$file)){ $time = filemtime($file); $data[$time] = "<a href=\"{server}/$file\">$file</a>".date( "F d Y H:i:s",$time)."<br>"; } } krsort($data); while(list($key,$val) = each($data)){ echo $val; } http://www.php.net/manual/en/function.filemtime.php

« previous php.notes (#15559) next »