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>";


Similar Posts

Leave a Reply

Your email address will not be published.