Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要执行以下 linux find 命令
find /home/*/mail/ -type d -name ".test" > tmp_file
但是使用 php (因为 find 命令由于某种原因在某些操作系统中冻结)。如何使用 php 进行此搜索并将结果放入 tmp_file?
谢谢
你可以随时使用FilesystemIterator,DirectoryIterator
FilesystemIterator
DirectoryIterator
http://ca2.php.net/manual/en/class.filesystemiterator.php
http://ca2.php.net/manual/en/class.directoryiterator.php
您可以使用 glob 函数。
看看http://php.net/manual/en/function.glob.php