Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP ftp_nlist() Function

PHP ftp_nlist() Function


PHP FTP Reference Manual Complete PHP FTP Reference Manual


Definition and Usage

The ftp_nlist() function returns a list of files in a specified directory on the FTP server.

Returns an array of file names in the specified directory on success, or FALSE on failure.

Syntax

ftp_nlist(ftp_connection,dir)

Parameters 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

The code above will output:

array(3)

{

[0]=> "flower.gif"

[1]=> "car.gif"

[2]=> "house.gif"

}


PHP FTP Reference Manual Complete PHP FTP Reference Manual