(PHP 8 >= 8.5.0)
Uri\WhatWg\Url::getFragment — Retrieve the fragment component
この関数にはパラメータはありません。
Returns the fragment component as a string if the fragment component exists, null is returned otherwise.
例1 Uri\WhatWg\Url::getFragment() basic example
<?php
$url = new \Uri\WhatWg\Url("https://example.com#foo");
echo $url->getFragment();
?>上の例の出力は以下となります。
foo