Uri\WhatWg\Url::getFragment

(PHP 8 >= 8.5.0)

Uri\WhatWg\Url::getFragmentRetrieve the fragment component

Опис

public function Uri\WhatWg\Url::getFragment(): ?string

Retrieves 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

Прогляньте також

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top