update page now

Uri\WhatWg\Url::getFragment

(PHP 8 >= 8.5.0)

Uri\WhatWg\Url::getFragmentRécupère le composant fragment

Description

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

Récupère le composant fragment.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Retourne le composant fragment sous forme de chaîne de caractères si le composant fragment existe, null est retourné sinon.

Exemples

Exemple #1 Exemple simple avec Uri\WhatWg\Url::getFragment()

<?php
$url
= new \Uri\WhatWg\Url("https://example.com#foo");

echo
$url->getFragment();
?>

L'exemple ci-dessus va afficher :

foo

Voir aussi

add a note

User Contributed Notes

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