Home  >  Article  >  Backend Development  >  关于遍历文件夹详细信息,该如何处理

关于遍历文件夹详细信息,该如何处理

WBOY
WBOYOriginal
2016-06-13 12:50:26740browse

关于遍历文件夹详细信息
php写的遍历文件夹程序,怎么样才能遍历出文件夹里文件的详细信息,比如文件名,最后修改时间,文件大小这些信息,求解答~~


------解决方案--------------------
你在这里输出了文件名
echo "{$FolderOrFile}
";
同样也可以输出该文件的其他信息
$fn = "$dir/$FolderOrFile";
echo filesize($fn); //文件大小
echo date('Y-m-d H:i:s', filecime($fn)); //创建时间
echo date('Y-m-d H:i:s', filemtime($fn)); //上次修改时间
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn