glob

Presumably, many people will write a few or even dozens of lines of code to make it list all the files into an array for deletion, but the glob function solves the problem in minutes!

 array_map('unlink', glob('*'));
Last modification: November 17, 2017
If you think my article is useful to you, please feel free to appreciate it