Uri\Rfc3986\Uri::getScheme
PHP function
Edit on GitHub ✎
(PHP 8 >= 8.5.0)
Retrieve the normalized scheme component
Description
Uri\Rfc3986\Uri::getScheme(): string|null
Retrieves the normalized scheme component.
Parameters Parameters
Return Values
Returns the normalized scheme component as a String if the scheme component exists, null is returned otherwise.
Examples
Uri\Rfc3986\Uri::getScheme basic example
php
<?php
$uri = new \Uri\Rfc3986\Uri("https://example.com");
echo $uri->getScheme();
?>The above example will output:
output
httpsSee Also
Uri\Rfc3986\Uri::getRawSchemeUri\Rfc3986\Uri::withSchemeUri\WhatWg\Url::getScheme