使用PHP脚本删除所有.htaccess文件形式的主机
我需要从主机删除所有.htaccess文件,但不幸的是,终端不可用,因此可以使用PHP脚本完成。 示例:主机路径是home/name/public_html/,在public_html文件夹中,还有其他文件夹和子文件夹,并且使用php脚本,我能够输出所有文件路径并计数所有.htaccess文件(左右9000)... 请任何人都可以帮助删除所有这些文件,因为文件夹(子文件夹)将需要数周的时间,因为有超过8K的文件夹/子文件夹。
提前致谢
i need to delete all .htaccess files from the host but unfortunately a terminal is not available so may be it can be done using a php script.
example: host path is home/name/public_html/ and inside the public_html folder there are other folders and subfolders and using a php script i was able to output all files path and count all .htaccess files (around 9000)...
Please anyone can help to delete all these files as going folder by folder(subfolder) will take weeks as there are more than 8k folders/subfolders.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢@lawrencecherone在 recursivedirectoryIterator
与示例获得了一个示例我几乎无法弄清楚的更改
这是脚本,以防将来任何人都需要它:
感谢所有人的帮助。
thanks to @LawrenceCherone for the indication on RecursiveDirectoryIterator
Got an example there and with few changes i was able to figure it out
Here is the script in case anyone will need it on future:
Thanks to all for the help.