Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

php directory auslesen

Empfohlene Antworten

Veröffentlicht

da hab ich doch mal ein fräggelchen:

gibt es einen befehl der mir dateien in einem verzeichnis ausliest und mir sortiert nach erstellungsdatum/zeit anzeigt ?

und wenn das geht

wie kann ich dann die zuletzt (sagen wir 2) erstellten dateien anzeigen?

es reicht mir auch aus wenn mir einer die befehle sagen kann ;) ich selbst hab bis jetzt noch nix gefunden :(

<ul>
<?php
function direcho($path) {
global $filetotal, $fullsize, $totaldirs;
if ($dir = opendir($path)) {
while (false !== ($file = readdir($dir))) {
if (is_dir($path."/".$file)) { // if it's a dir, check it's contents too
if ($file != '.' && $file != '..') { // but dont go recursive on '.' and '..'
echo '<li><b>' . $file . '</b> (Ordner)</li><ul>';
direcho($path."/".$file);
echo '</ul>';
$totaldirs++;
}
}
else { //if it's not a dir, just output.
$tab = " ";
$filesize = $tab . '(' . filesize ($path.'/'.$file) . ' kb)';
if($file == "db_connect.php") echo "";
else {
echo '<li><a href="' . $path.'/'.$file. '" target="_blank">'.$file.'</a></li>';
$fullsize = $fullsize + filesize ($path.'/'.$file);
$filetotal++;
}
}
}
closedir($dir);
}
}
direcho('.');
$fullsize = round($fullsize / 1024 / 1024, 2);
echo "</ul>";
echo"<br><br><b>Dateien insgesamt:</b> $filetotal<br><b>Ordner insgesamt:</b> $totaldirs<br>
<b>Dateigröße insgesamt:</b> $fullsize MB";
?>[/php]

^^ Dieses Script liest Verzeichnisse aus und zeigt deren Inhalt(e) an. Du müsstest es so umbauen, dass die Dateinamen in ein Array gelesen werden, welches dann mit sort in Verbindung mit getlastmod sortiert bzw. ausgegeben wird.

Infos zu den genannten PHP-Befehlen findest du auf www.php.net/manual/de.

Danke :e@sy :marine

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.