delite - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of delite.php
- <?php
- function removeEmptyFolders($path)
- {
- $isFolderEmpty = true;
- if(substr($path, -1) == "/")
- $pathForGlob = $path . "*";
- else
- $pathForGlob = $path . DIRECTORY_SEPARATOR . "*";
- foreach (glob($pathForGlob) as $file)
- {
- if (is_dir($file))
- {
- if (!removeEmptyFolders($file))
- $isFolderEmpty = false;
- }
- else
- {
- $isFolderEmpty = false;
- }
- }
- if ($isFolderEmpty)
- rmdir($path);
- return $isFolderEmpty;
- }
- removeEmptyFolders("C:\Users\grzda\OneDrive\Dekstop\test");
- ?>
File Description
- delite
- PHP Code
- 25 Nov-2022
- 651 Bytes
You can Share it:
Latest PHP Pastes