php - Unlink/Delete files which starts with a dot
问题描述
I'm trying to delete (unlink) files which starts with a dot.
This is my approach:
$dirList = glob('*');
foreach ($dirList as $file) {
if(time() - filectime($file) > 7200) {
unlink($file);
}
}
Its deleting every file which is older than 2 hours, but only those which dont start with a dot. Files which starts with a dot are not deleting. How can I solve this? I was thinking about using exec, but I want to use the php way if there are any possibilities to solve this using php.
解决方案
推荐阅读
- reactjs - 为什么我无法在下拉菜单中的搜索字段中找到光标?
- android - 合并 dex 档案时构建 APK 错误时出现错误
- sql-server - 如何处理跨多个表插入大量数据(1500 万)的事务
- android - 我收到错误无法验证证书链,错误:java.security.cert.CertPathValidatorException
- reactjs - 如何将 CoreUI/react 与 typescript 集成
- java - 使用 Gson 将 JSON 数组解析为 Java 列表
- bash - 如何使用 grep 从 find 命令的输出中忽略/排除文件?
- database - 事务与存储过程
- javascript - 将 Angular 组件降级为 AngularJS
- python - 突出显示 MultiIndex DataFrame 上的 max/min - Pandas