ftp_nlist
Returns the list of files in the specified directory.
ftp_nlist()
function returns a list of files in the specified directory.
If successful, return an array of file names in the given directory, otherwise false.
<?php $conn = ftp_connect("ftp.testftp.com") or die("Could not connect"); ftp_login($conn,"admin","ert456"); print_r(ftp_nlist($conn,"images")); ftp_close($conn); ?>
输出类似:
array(3) { [0]=> "flower.gif" [1]=> "car.gif" [2]=> "house.gif" }
ftp_nlist ( ftp_connection , dir )
parameter | describe |
---|---|
ftp_connection | Required. Specifies the FTP connection to be used (the identifier of the FTP connection). |
dir | Required. Specify the directory to be inspected. Use "." to get the current directory. |