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