php - opendir,强制列出隐藏文件(ftp) [英] php - opendir, force listing hidden files (ftp)

查看:232
本文介绍了php - opendir,强制列出隐藏文件(ftp)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何强制在PHP脚本中使用ftp连接列出隐藏文件?是否有opendir的任何上下文选项?



谢谢

ftp_rawlist - 返回给定目录中的文件的详细列表(raw => ALL,隐藏)



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






有一个 ftp_rawlist 的评论:


获取所有文件的列表,包括除'。'或'..'之外的隐藏文件用途:

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

这让我在圈内跳舞了一段时间!



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

Thanks

解决方案

"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!

这篇关于php - opendir,强制列出隐藏文件(ftp)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆