public static function hasExtension(string $uri, string $extension): bool
    {
        $extension       = '.' . ltrim($extension, '.');
        $uriLength       = mb_strlen($uri);
        $extensionLength = mb_strlen($extension);
        if ($extensionLength > $uriLength) {
            return false;
        }

        return substr_compare($uri, $extension, $uriLength - $extensionLength, $extensionLength) === 0;
    }
public static function hasExtension(string $uri, string $extension): bool
    {
        $extension       = '.' . ltrim($extension, '.');
        $uriLength       = mb_strlen($uri);
        $extensionLength = mb_strlen($extension);
        if ($extensionLength > $uriLength) {
            return false;
        }

        return substr_compare($uri, $extension, $uriLength - $extensionLength, $extensionLength) === 0;
    }
public static function hasExtension ( string $ uri , string $ extension ) : bool { $ extension = '.' . ltrim ( $ extension , '.' ) ; $ uriLength = mb_strlen ( $ uri ) ; $ extensionLength = mb_strlen ( $ extension ) ; if ( $ extensionLength > $ uriLength ) { return false ; } return substr_compare ( $ uri , $ extension , $ uriLength - $ extensionLength , $ extensionLength ) === 0 ; }
Check whether a given URI has a specific extension.

@since 0.1.3

@param string $uri       URI to check the extension of.
@param string $extension Extension to check for.

@return bool
Check whether a given URI has a specific extension .