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.
我想用 php 检查我的目录中是否存在带有起始掩码 TEMP 的目录
我的临时目录如下所示:
TEMP20130222001408378716等
$dir="mydirecrtory/*"; $dirmask="TEMP"; foreach(glob($dir/TEMP*) AS tempdir) if (!is_dir($dir/$tempdir) || !$dir = opendir($dir/$tempdir)) { rmdir($dir/$tempdir); }