WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Php ftp_rawlist () function


Definition and usage

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

Syntax

ftp_rawlist (ftp_connection, dir, recursive)

parameters description
ftp_connection Required. Specifies the FTP connection to use.
dir Required. Specify the directory. Use "." To specify the current directory.
recursive Optional. By default, this function sends a "LIST" command to the server. However, if the recursive parameter is set to TRUE, the "LIST -R" command is sent.


Tips and comments

Note: This function returns the server's response as an array. No parsing is performed.


Example

<?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);
?>

The above code will output:

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
)