public static function removeDir($path)
    {
        if (is_file($path)) {
            unlink($path);
        } else {
            foreach (scandir($path) as $dir) {
                if ($dir === '.' || $dir === '..') {
                    continue;
                }

                static::removeDir($path.'/'.$dir);
            }

            rmdir($path);
        }
    }
public static function removeDir($path)
    {
        if (is_file($path)) {
            unlink($path);
        } else {
            foreach (scandir($path) as $dir) {
                if ($dir === '.' || $dir === '..') {
                    continue;
                }

                static::removeDir($path.'/'.$dir);
            }

            rmdir($path);
        }
    }
public static function removeDir ( $ path ) { if ( is_file ( $ path ) ) { unlink ( $ path ) ; } else { foreach ( scandir ( $ path ) as $ dir ) { if ( $ dir === '.' || $ dir === '..' ) { continue ; } static :: removeDir ( $ path . '/' . $ dir ) ; } rmdir ( $ path ) ; } }
Recursive remove dir

@access public

@param string $path path to remove

@return void
@static
Recursive remove dir