note 58246 added to function.filemtime
| From: | alejoar at gmail dot com | Date: | Fri, 28 Oct 2005 19:06:21 +0000 |
| Subject: | note 58246 added to function.filemtime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-97757@lists.php.net to get a copy of this message | ||
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;
?>
----
Manual Page -- http://www.php.net/manual/en/function.filemtime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58246
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58246&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58246&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58246&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58246&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58246&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58246&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58246&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58246&report=yes
Search -- http://master.php.net/manage/user-notes.php