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 类型的情况下删除文件吗?我想做这样的事情:
unlink('../gallery/images/pic23.?)
我该怎么做?提前致谢
您可以找到所有文件,glob()然后单独删除它们,如下所示:
glob()
foreach( glob( '../gallery/images/pic23.*') as $file) { unlink( $file); }