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.

verzeichnisnamen von unterverzeichnis ausgeben

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich bastel gerade an einem Bilduploadscript und würde jetzt gerne wissen wie ich die Namen von Verzeichnissen aus einem Unterverzeichnisse mittels PHP ausgeben lassen kann?

Gruß Jan

Hallo, erstmal danke für deine Antwort, aber mit is_dir kann ich doch nur prüfen ob ein Verzeichnis vorhanden ist, Rückgabewert ist ja true oder false und nicht der Name...

Aber du kannst doch alle Namen eines Verzeichnisses lesen und dann fragst per is_dir ab, obs n Verzeichnis is, wenn ja: dann nimmst den Namen als Verzeichnisnamen... fertig... oder wo ist das Prob?

Naj, so schwierig ist das aber nicht. Mit ein bißchen Mühe kann man das schon rausfinden. Immerhin ist PHP ziemlich gut dokumentiert: http://de.php.net/manual/de/

Aber weil ich immer so ein Codeschnipsel rumfliegen habe:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>dir-test</title>
</head>
<body>
<?php
$d = dir('.');
while (false !== ($entry = $d->read()))
if (is_dir($entry) && $entry != '.' && $entry != '..')
echo $entry.'<br />';
$d->close();
?>
</body>
</html>
[/PHP]

Grüße, Tobias

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.