Using scandir() to find folders in a directory (PHP)

前端 未结 9 2075
Happy的楠姐
Happy的楠姐 2020-12-02 13:11

I am using this peice of code:

$target = \'extracted/\' . $name[0];  
$scan = scandir($target);

To scan the directory of a folder which is

9条回答
  •  庸人自扰
    2020-12-02 14:12

    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.

提交回复
热议问题