private static function rrmdir($path)
    {
        $path .= '/';

        foreach (array_diff(scandir($path), array('..', '.')) as $file) {
            $current = $path . $file;

            if (is_dir($current)) {
                if (self::rrmdir($current) === false) {
                    return false;
                }
            } elseif (unlink($current) === false) {
                return false;
            }
        }

        return rmdir($path);
    }
private static function rrmdir($path)
    {
        $path .= '/';

        foreach (array_diff(scandir($path), array('..', '.')) as $file) {
            $current = $path . $file;

            if (is_dir($current)) {
                if (self::rrmdir($current) === false) {
                    return false;
                }
            } elseif (unlink($current) === false) {
                return false;
            }
        }

        return rmdir($path);
    }
private static function rrmdir ( $ path ) { $ path .= '/' ; foreach ( array_diff ( scandir ( $ path ) , array ( '..' , '.' ) ) as $ file ) { $ current = $ path . $ file ; if ( is_dir ( $ current ) ) { if ( self :: rrmdir ( $ current ) === false ) { return false ; } } elseif ( unlink ( $ current ) === false ) { return false ; } } return rmdir ( $ path ) ; }
Remove recursive folders

@param string $path
@return bool
Remove recursive folders