I am using this peice of code..
$target = 'extracted/' . $name[0];
$scan = scandir($target);
To scan the directory of a folder which is used for zip uploads. I want to be able to find all the folders inside my $target
folder so i can delete them and there contents, leaving only the files in the $target directory.
Once i have returned the contents of the folder, i dont know how to differentiate between the folders and the files to be able to delete the folders.
Also, i have been told that the rmdir() function cant delete folders which have content inside them, is there anyway around this?
Thanks, Ben.