If you want to remove or delete files from a specific folder or directory then following code snippet will help you to remove files. This code work recursively and delete all files inside that directory.

delete files from specific folders or directory


function EmptyDir($dir) {

while (($file = readdir($handle))!==false) {
echo "$file <br>";


Leave a Reply

Your email address will not be published. Required fields are marked *