[英]Delete all files that it's name end with specific string
How to delete all files that it's name end with specific character 如何删除名称以特定字符结尾的所有文件
example of files that i want to delete 我要删除的文件的示例
/images/m/tme-500x500-3092.jpg
/images/m/tme-200x200-3092.jpg
/images/m/tme-300x400-3092.jpg
code 码
$files = glob($basePath . '/../images/m/"*"3092.jpg');
foreach ($files as $file) {
unlink($file);
}
what should i replace "*" with ? 我应该用“ *”代替什么?
Are you joking? 你在开玩笑? :-)
:-)
Assuming that the path is right. 假设路径正确。
$files = glob($basePath . '/../images/m/tme-*-3092.jpg');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.