Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
ftp_nlist — Gibt eine Liste der im angegebenen Verzeichnis enthaltenen Dateien zurück
<?php
$handle = "./"; //fuer aktuelle dir
$scan = scandir ($handle);
foreach ($scan as $datei)
{
echo"<a href='./$datei'>$datei</a><br/>";
}
<?php
$handle = "./"; //fuer aktuelle dir
$scan = scandir ($handle);
foreach ($scan as $datei)
{
if(!is_dir("$datei"))
{
echo"<a href='./$datei'>$datei</a><br/>";
}
}
<?php
$ftp_user = "anonymous";
$ftp_pass = "password";
$ftp_host = "85.10.197.148";
$ftp_port = 21;
$ftp_dir = ""; //falls innerhalb von ftp noch das verzeichnis gewechselt werden soll, hier das verzeichnis rein.
$address = "ftp://".$ftp_user.":".$ftp_pass."@".$ftp_host.":".$ftp_port;
if($ftp_dir != "") {
$address .= "/".$ftp_dir;
}
$handle = dir($address);
while (false !== ($entry = $handle->read())) {
echo $entry."<br />\n";
}
$handle->close();
?>
Warum PHP5? Das sollte nach PHP: FTP and FTPS - Manual auch in PHP4 funktionieren.
Die Verzeichnis-Klasse dir() gab es auch schon in PHP4. Das einzige was hier PHP5-only war, ist scandir() und die könnte man auch direkt mit einer URL aufrufen.
ChangeLog
Version Description
5.0.0 path supports the ftp:// URL wrapper.
4.3.0 path can also be any URL which supports directory listing, however only the file:// URL wrapper supports this in PHP 4
nö
damit sollte man jedes beliebige Verzeichnis von Überall öffnen können..http://de.php.net/manual/de/class.dir.php schrieb:class Directory {
string $path ;
resource $handle ;
string read ( void )
void rewind ( void )
void close ( void )
}