|
PHP ftp_nlist() Function
Complete PHP FTP Reference
Definition and Usage
The ftp_nlist() function lists the files in a specified directory on the FTP
server.
This function returns an array of file names on success or FALSE on failure.
Syntax
|
ftp_nlist(ftp_connection,dir)
|
| Parameter |
Description |
| ftp_connection |
Required. Specifies the FTP connection to use |
| dir |
Required. Specifies the directory to check. Use "." to get the
current directory |
Tips and Notes
Note: This function does not work with IIS (Internet Information
Server). It returns nothing.
Example
<?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);
?>
|
The output of the code above could be:
array(3)
{
[0]=> "flower.gif"
[1]=> "car.gif"
[2]=> "house.gif"
}
|
Complete PHP FTP Reference
 |
W3Schools' Online Certification Program
The perfect solution for professionals who need to balance work, family, and career building.
More than 3500 certificates already issued!
|
The HTML Certificate documents your knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
|