Pyh.conf’25: a new PHP conference for the Russian-speaking community

Voting

: six plus one?
(Example: nine)

The Note You're Voting On

sksafarath at impelsys dot com
18 years ago
If we are giving second parameter as full directory path then it wil return the list of files with full path, If we want to list only files you can do as following code
// set up basic connection
$conn_id = ftp_connect($ftp_server);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
//if u want to display the files from /home/test/
//change directory point to /home/test using
ftp_chdir($conn_id, "test");
//then pass second parameter as null which will give the list of files.
// get contents of the current directory
$contents = ftp_nlist($conn_id, "");

Note: This is working for me in PHP5

<< Back to user notes page

To Top