Non-Recursively Deleting A Folder In PHP
In PHP, you can’t just delete a folder using rmdir unless the folder’s empty. You can, however, do so using rmdirr function, wherein it will remove both the folder and its contents recursively. But using this [recursive] method opens up the possibility for PHP to segfault/crash, specifically and especially if you have deeply nested directories [...]