PHP: Simplest way to delete a folder (including its contents)

后端 未结 7 2018
刺人心
刺人心 2020-12-08 14:00

The rmdir() function fails if the folder contains any files. I can loop through all of the the files in the directory with something like this:



        
相关标签:
7条回答
  • 2020-12-08 14:37

    Well, there's always

    system('/bin/rm -rf ' . escapeshellarg($dir));
    

    where available.

    0 讨论(0)
提交回复
热议问题