dormbaf90464 2009-10-12 12:36
浏览 133
已采纳

如果服务器上存在文件夹,如何使用PHP FTP功能检查?

Is there a way to check if a a folder exists on the server using PHP Ftp functionality?

  • 写回答

10条回答 默认 最新

  • doujianchao7446 2009-10-12 12:42
    关注

    For PHP 5:

    $folder_exists = is_dir('ftp://user:password@example.com/some/dir/path');
    

    http://php.net/manual/en/function.is-dir.php : "As of PHP 5.0.0, this function can also be used with some URL wrappers."

    http://php.net/manual/en/wrappers.ftp.php : [Support] "As of PHP 5.0.0: filesize(), filetype(), file_exists(), is_file(), and is_dir()"

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(9条)

报告相同问题?