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