![]() ![]() This site is for inclusion only, and the copyright belongs to the original author. ![]() The post Native php recursively delete files folders first appeared on Lenix Blog. How do I recursively delete a directory and its entire contents (files sub dirs) in PHP In PHP how do I recursively remove all folders that arent. ![]() I have a function to delete a folder and all contents including subfolders and files.Native php recursively delete files folders '.$file.'success' unlink($file) } } } closedir($dir) echo 'Delete directory'.$dirname.'success' rmdir($dirname) } } deldir('D:\123') //For example, the file is in the 123 directory of the d drive?> Explanation: Removes the specified directory recursively only if the path exists and escapes the path so that it can only be used as a shell argument to avoid shell command injection. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |