php8.5
Home/ Manual/ rfc3986 / uri/ Uri\Rfc3986\Uri::getRawFragment

Uri\Rfc3986\Uri::getRawFragment

PHP function Edit on GitHub ✎

(PHP 8 >= 8.5.0)

Retrieve the raw fragment component

Description

Uri\Rfc3986\Uri::getRawFragment(): string|null

Retrieves the raw (non-normalized) fragment component.

Parameters Parameters

Return Values

Returns the raw fragment component as a String if the fragment component exists, null is returned otherwise.

Examples

Uri\Rfc3986\Uri::getRawFragment basic example

php
<?php
$uri = new \Uri\Rfc3986\Uri("https://example.com#foo=bar");

echo $uri->getRawFragment();
?>

The above example will output:

output
foo=bar

See Also

  • Uri\Rfc3986\Uri::getFragment
  • Uri\Rfc3986\Uri::withFragment
  • Uri\WhatWg\Url::getFragment

Source: reference/uri/uri/rfc3986/uri/getrawfragment.xml · from the official PHP manual (php/doc-en)