Re: new FTP function
| From: | Paul Dragoonis | Date: | Fri, 18 Jan 2013 15:30:39 +0000 |
| Subject: | Re: new FTP function | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-65028@lists.php.net to get a copy of this message | ||
Revised function:
function dir_exists($conn, $currentDir) {
$list = ftp_nlist($conn, '-dF '. $currentDir);
return in_array($dir, $list);
}
On Fri, Jan 18, 2013 at 3:28 PM, Paul Dragoonis <dragoonis@gmail.com> wrote:
>
> On Fri, Jan 18, 2013 at 3:18 PM, KISE <wowkise@gmail.com> wrote:
>
>> $res = ftp_nlist($this->conn_id, '-dF '. $dir);
>>
>
> This could be done in two lines.
>
> function dir_exists($conn, $dir) {
> $list = ftp_nlist($conn, '-dF '. $dir);
> return in_array($dir, $list);
> }
>