note 58246 deleted from function.filemtime by betz
| From: | betz@php.net | Date: | Fri, 28 Oct 2005 19:38:14 +0000 |
| Subject: | note 58246 deleted from function.filemtime by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-97760@lists.php.net to get a copy of this message | ||
Note Submitter: alejoar at gmail dot com
Reason: non-english
----
Este pequeño script es para obtener el ultimo archivo o carpeta modificado dentro de otra carpeta:
<?
$dir = '.';
if ($gestor = opendir($dir)) {
while (false !== ($carpeta = readdir($gestor))) {
if ($carpeta != "." && $carpeta != "..") {
$modificado = filemtime("$dir/$carpeta");
if ($modificado > $temp) {
$temp = filemtime("$dir/$carpeta");
$ultimo = $carpeta;
}
}
}
closedir($gestor);
}
echo $ultimo;
?>