I am using this peice of code:
$target = \'extracted/\' . $name[0]; $scan = scandir($target);
To scan the directory of a folder which is
First off, rmdir() cannot delete a folder with contents. If safe mode is disabled you can use the following.
exec("rm -rf folder/");
Also look at is_dir()/is_file() or even better the PHP SPL.