php - opendir, force listing hidden files (ftp)

跟風遠走 提交于 2019-12-08 07:51:02

问题


How to force listing hidden files with ftp connection in PHP script? Is there any context option for opendir?

Thanks


回答1:


"ftp_rawlist — Returns a detailed list of files in the given directory" (raw => ALL incl. hidden)

https://secure.php.net/manual/en/function.ftp-rawlist.php


There is one comment to the ftp_rawlist:

Get a listing of all files including hidden files except '.' or '..' use:

<?php
ftp_chdir($connid, $dir);
ftp_rawlist($connid, "-A");
?>

This had me dancing in circles for some time!



来源:https://stackoverflow.com/questions/23346935/php-opendir-force-listing-hidden-files-ftp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!