Latest web development tutorials
×

PHP Kurs

PHP Kurs PHP Kurze Einführung PHP installieren PHP Grammatik PHP Variable PHP echo/print PHP Datentypen PHP Konstante PHP Schnur PHP Die Betreiber PHP If...Else PHP Switch PHP Feld PHP Sortieren eines Array PHP Superglobals PHP While Verkehr PHP For Verkehr PHP Funktion PHP Magische Variablen PHP Namespaces PHP Objektorientiert

PHP Form

PHP Form PHP Formularauthentifizierung PHP Form - Erforderliche Felder PHP Form - Überprüfung E-Mail und URL PHP Komplette Formularinstanz PHP $_GET Variable PHP $_POST Variable

PHP Erweiterte Tutorial

PHP Mehrdimensionale Arrays PHP Datum PHP enthalten PHP Datei PHP Datei-Upload PHP Cookie PHP Session PHP E-mail PHP Sicherheit E-mail PHP Error PHP Exception PHP Filter PHP Erweiterte Filter PHP JSON

PHP 7 Neue Funktionen

PHP 7 Neue Funktionen

PHP Datenbank

PHP MySQL Kurze Einführung PHP MySQL Verbindung PHP MySQL Erstellen einer Datenbank PHP MySQL Erstellen Sie eine Datentabelle PHP MySQL einfügen von Daten PHP MySQL Legen Sie mehrere Daten PHP MySQL Prepared Statements PHP MySQL Lesen Sie Daten PHP MySQL WHERE PHP MySQL ORDER BY PHP MySQL UPDATE PHP MySQL DELETE PHP ODBC

PHP XML

XML Expat Parser XML DOM XML SimpleXML

PHP & AJAX

AJAX Kurze Einführung AJAX PHP AJAX Datenbank AJAX XML AJAX Echtzeitsuche AJAX RSS Reader AJAX Abstimmung

PHP Referenzhandbuch

PHP Array PHP Calendar PHP cURL PHP Date PHP Directory PHP Error PHP Filesystem PHP Filter PHP FTP PHP HTTP PHP Libxml PHP Mail PHP Math PHP Misc PHP MySQLi PHP PDO PHP SimpleXML PHP String PHP XML PHP Zip PHP Timezones PHP Bildverarbeitung PHP RESTful

PHP rewinddir () Funktion

PHP-Verzeichnis PHP Directory - Referenz

Beispiele

Öffnen Sie ein Verzeichnis, das die Dateien auflistet, Verzeichnis-Handle zum Aufladen, Wieder Liste der Dateien und schaltet sich ab:

<?php
$dir = "/images/";

// Open a directory, and read its contents
if (is_dir($dir)){
if ($dh = opendir($dir)){
// List files in images directory
while (($file = readdir($dh)) !== false){
echo "filename:" . $file . "<br>";
}
rewinddir();
// List once again files in images directory
while (($file = readdir($dh)) !== false){
echo "filename:" . $file . "<br>";
}
closedir($dh);
}
}
?>

Ergebnisse:

filename: cat.gif
filename: dog.gif
filename: horse.gif
filename: cat.gif
filename: dog.gif
filename: horse.gif


Definition und Verwendung

rewinddir () Funktion zurückgesetzt wird opendir () Verzeichnis - Handle erstellt.


Grammatik

rewinddir( dir_handle );

参数 描述
dir_handle 可选。指定之前由 opendir() 打开的目录句柄资源。如果该参数未指定,则使用最后一个由 opendir() 打开的链接。

Technische Details

Rückkehr: -
PHP-Version: 4.0+


PHP-Verzeichnis PHP Directory - Referenz