PHP 4, PHP 5, PHP 7, PHP 8
ftp_rawlist - Returns a detailed list of files in the given directory
Code Examples

ftp_rawlist( FTP\Connection$ftp, string$directory, [bool$recursive = false] ): array|false

ftp_rawlist executes the FTP LIST command, and returns the result as an array.



An FTP\Connection instance.


The directory path. May include arguments for the LIST command.


If set to true, the issued command will be LIST -R.

Return Values

Returns an array where each element corresponds to one line of text. Returns false when passed directory is invalid.

The output is not parsed in any way. The system type identifier returned by ftp_systype can be used to determine how the results should be interpreted.


Version Description
8.1.0 The ftp parameter expects an FTP\Connection instance now; previously, a resource was expected.

Related Functions

Example of ftp_rawlist

Show all examples for ftp_rawlist

PHP Version: