This will delete all files in a directory matching a pattern in one line of code.
<?php array_map('unlink', glob("some/dir/*.txt")); ?>
This will delete all files in a directory matching a pattern in one line of code.
<?php array_map('unlink', glob("some/dir/*.txt")); ?>