PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<ftp_nb_putftp_pasv>
Last updated: Mon, 16 Jul 2012

ftp_nlist

(PHP 3 >= 3.0.13, PHP 4, PHP 5)

ftp_nlist -- 返回给定目录的文件列表

说明

array ftp_nlist ( resource ftp_stream, string directory )

如果成功则返回给定目录下的文件名组成的数组,否则返回 FALSE

例子 1. ftp_nlist() 例子

<?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";
}
?>

参见 ftp_rawlist()




<ftp_nb_putftp_pasv>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST