private function deleteFiles($dirPath)
    {
        foreach (glob($dirPath.DIRECTORY_SEPARATOR.'{*,.[!.]*,..?*}', GLOB_BRACE) as $content) {
            if (is_dir($content)) {
                $this->deleteFiles($content);
            } else {
                unlink($content);
            }
        }
        rmdir($dirPath);
    }
private function deleteFiles($dirPath)
    {
        foreach (glob($dirPath.DIRECTORY_SEPARATOR.'{*,.[!.]*,..?*}', GLOB_BRACE) as $content) {
            if (is_dir($content)) {
                $this->deleteFiles($content);
            } else {
                unlink($content);
            }
        }
        rmdir($dirPath);
    }
private function deleteFiles ( $ dirPath ) { foreach ( glob ( $ dirPath . DIRECTORY_SEPARATOR . '{*,.[!.]*,..?*}' , GLOB_BRACE ) as $ content ) { if ( is_dir ( $ content ) ) { $ this -> deleteFiles ( $ content ) ; } else { unlink ( $ content ) ; } } rmdir ( $ dirPath ) ; }
Deletes recursively a directory and its content.

@param $dirPath The path to the directory to delete
Deletes recursively a directory and its content .