public static function unlink($path)
    {
        $isWindows = DIRECTORY_SEPARATOR === '\\';

        if (!$isWindows) {
            return unlink($path);
        }

        if (is_link($path) && is_dir($path)) {
            return rmdir($path);
        }

        try {
            return unlink($path);
        } catch (ErrorException $e) {
            // last resort measure for Windows
            $lines = [];
            exec('DEL /F/Q ' . escapeshellarg($path), $lines, $deleteError);
            return $deleteError !== 0;
        }
    }
public static function unlink($path)
    {
        $isWindows = DIRECTORY_SEPARATOR === '\\';

        if (!$isWindows) {
            return unlink($path);
        }

        if (is_link($path) && is_dir($path)) {
            return rmdir($path);
        }

        try {
            return unlink($path);
        } catch (ErrorException $e) {
            // last resort measure for Windows
            $lines = [];
            exec('DEL /F/Q ' . escapeshellarg($path), $lines, $deleteError);
            return $deleteError !== 0;
        }
    }
public static function unlink ( $ path ) { $ isWindows = DIRECTORY_SEPARATOR === '\\' ; if ( ! $ isWindows ) { return unlink ( $ path ) ; } if ( is_link ( $ path ) && is_dir ( $ path ) ) { return rmdir ( $ path ) ; } try { return unlink ( $ path ) ; } catch ( ErrorException $ e ) { // last resort measure for Windows $ lines = [ ] ; exec ( 'DEL /F/Q ' . escapeshellarg ( $ path ) , $ lines , $ deleteError ) ; return $ deleteError !== 0 ; } }
Removes a file or symlink in a cross-platform way

@param string $path
@return bool
Removes a file or symlink in a cross - platform way