Current Location: Home> Function Categories> ftp_rawlist

ftp_rawlist

Returns a detailed list of files in the specified directory.
Name:ftp_rawlist
Category:Uncategorized
Programming Language:php
One-line Description:Returns a detailed list of files in the specified directory.

Definition and usage

ftp_rawlist() function returns a detailed list of files in the specified directory.

实例

<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");

print_r (ftp_rawlist($conn,"."));

ftp_close($conn);
?>

输出类似:

Array 
( 
[0] => dr--r--r-- 1 user group 0 Feb 15 13:02 .
[1] => dr--r--r-- 1 user group 0 Feb 15 13:02 ..
[2] => drw-rw-rw- 1 user group 0 Jan 03 08:33 images
[3] => -rw-rw-rw- 1 user group 160 Feb 16 13:54 test.php
[4] => -rw-rw-rw- 1 user group 20 Feb 14 12:22 test.txt
)

grammar

 ftp_rawlist ( ftp_connection , dir , recursive )
parameter describe
ftp_connection Required. Specifies the FTP connection to be used (the identifier of the FTP connection).
dir Required. Specified catalog. Use "." to specify the current directory.
Recursive Optional. By default, this function sends a "LIST" command to the server. If, if the recursive parameter is set to true, the "LIST -R" command is sent.

illustrate

The ftp_rawlist() function executes the FTP LIST command and returns the result as an array. Each element of the array is each line of the return text, and the output structure will not be parsed.

Use the function ftp_systype() to determine the type of the FTP server, so it can be used to determine the type of the return list.

Similar Functions
Popular Articles