Skip to content

Uri: getFragment Example

Terry L edited this page Jun 20, 2020 · 3 revisions
Clone this wiki locally

Shieldon\Psr7\Uri

getFragment

Retrieve the fragment component of the URI.

  • return string

Example:

$uri = new \Shieldon\Psr7\Uri(
    'https://example.com/post/?p=113&foo=bar#yes-i-do'
);

echo $uri->getFragment();
// Outputs: yes-i-do