note 69107 added to function.ftp-nlist
| From: | sksafarath at impelsys dot com | Date: | Wed, 23 Aug 2006 11:17:42 +0000 |
| Subject: | note 69107 added to function.ftp-nlist | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116223@lists.php.net to get a copy of this message | ||
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
----
Server IP: 203.199.107.94
Probable Submitter: 203.200.24.132
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.ftp-nlist.php
Edit -- https://master.php.net/note/edit/69107
Del: integrated -- https://master.php.net/note/delete/69107/integrated
Del: useless -- https://master.php.net/note/delete/69107/useless
Del: bad code -- https://master.php.net/note/delete/69107/bad+code
Del: spam -- https://master.php.net/note/delete/69107/spam
Del: non-english -- https://master.php.net/note/delete/69107/non-english
Del: in docs -- https://master.php.net/note/delete/69107/in+docs
Del: other reasons-- https://master.php.net/note/delete/69107
Reject -- https://master.php.net/note/reject/69107
Search -- https://master.php.net/manage/user-notes.php