PHP中的ftp_nlist()函数
ftp_nlist()函数返回FTP服务器上指定目录中的文件列表。
语法
ftp_nlist(con,dir);
参数
con-FTP连接
dir-要列出的目录
返回
ftp_nlist()函数成功返回一个文件名数组,失败则返回FALSE。
示例
以下是一个示例,其中我们获取当前目录中的文件列表-
<?php
$ftp_server = "192.168.0.4";
$ftp_user = "tim";
$ftp_pass = "wthbn#@121";
$con = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($con, $ftp_user, $ftp_pass);
$list = ftp_nlist($con, ".");
var_dump($list);
//关闭
ftp_close($con);
?>热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短