note 83021 added to function.ftp-nlist
| From: | juhakala at gmail dot com | Date: | Wed, 07 May 2008 10:23:12 +0000 |
| Subject: | note 83021 added to function.ftp-nlist | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139124@lists.php.net to get a copy of this message | ||
I noticed that this function won't work if working path is different, because $dir keeps value
of whole path string. That's why adding basename()-function strips the path and this function
will work also sub folders, not only in root folder.
function ftp_is_dir($dir) {
global $ftp_connect;
if (ftp_chdir($ftp_connect, basename($dir))) {
ftp_chdir($ftp_connect, '..');
return true;
} else {
return false;
}
}
----
Server IP: 62.237.7.3
Probable Submitter: 62.183.169.120
----
Manual Page -- http://www.php.net/manual/en/function.ftp-nlist.php
Edit -- https://master.php.net/note/edit/83021
Del: integrated -- https://master.php.net/note/delete/83021/integrated
Del: useless -- https://master.php.net/note/delete/83021/useless
Del: bad code -- https://master.php.net/note/delete/83021/bad+code
Del: spam -- https://master.php.net/note/delete/83021/spam
Del: non-english -- https://master.php.net/note/delete/83021/non-english
Del: in docs -- https://master.php.net/note/delete/83021/in+docs
Del: other reasons-- https://master.php.net/note/delete/83021
Reject -- https://master.php.net/note/reject/83021
Search -- https://master.php.net/manage/user-notes.php