Returns an array of filenames from the specified directory on success or FALSE on error.
<?php
// set up basic connection
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// check connection
if ((!$conn_id) || (!$login_result)) {
die("FTP connection has failed !");
}
// get contents of the root directory
$contents = ftp_nlist($conn_id, "/");
// print each entry
foreach ($contents as $entry) {
echo $entry, "<br />\n";
}
?>See also ftp_rawlist().
| This HTML Help has been published using the chm2web software. |