PHP ftp_mlsd() Functie
Voorbeeld
Retourneert de lijst met bestanden uit de map "images":
<?php
// connect and login to FTP server
$ftp_server = "ftp.example.com";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
$dir = "/images";
$dirlist = ftp_mlsd($ftp_conn, $dir);
// output directory list
echo($dirlist);
// close connection
ftp_close($ftp_conn);
?>
Definitie en gebruik
De functie ftp_mlsd() retourneert de lijst met bestanden in de opgegeven map.
Syntaxis
ftp_mlsd(ftp_conn, dir);
Parameterwaarden
Parameter | Description |
---|---|
ftp_conn | Required. Specifies the FTP connection to use |
dir | Required. Specifies the name of the directory to be listed. Use "." to get the current directory |
Technische details
Winstwaarde: | Een array met bestandsinformatie uit de opgegeven map bij succes, ONWAAR bij mislukking |
---|---|
PHP-versie: | 7.2+ |
❮ PHP FTP-referentie