Uri\Rfc3986\Uri::getFragment
PHP Manual
PHP Manual»Uri\Rfc3986\Uri»Uri\Rfc3986\Uri::getFragment

Uri\Rfc3986\Uri::getFragment

(PHP 8 >= 8.5.0)

Uri\Rfc3986\Uri::getFragmentRécupère le composant fragment normalisé

Description

public function Uri\Rfc3986\Uri::getFragment(): ?string

Récupère le composant fragment normalisé.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Retourne le composant fragment normalisé sous forme de string si le composant fragment existe, null est retourné sinon.

Exemples

Exemple #1 Exemple simple avec Uri\Rfc3986\Uri::getFragment()

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

echo $uri->getFragment();
?>

L'exemple ci-dessus va afficher :

foo=bar

Voir aussi

To Top