update page now

Uri\WhatWg\Url::getFragment

(PHP 8 >= 8.5.0)

Uri\WhatWg\Url::getFragmentRecupera el componente de fragmento

Descripción

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

Recupera el componente de fragmento.

Parámetros

Esta función no contiene ningún parámetro.

Valores devueltos

Devuelve el componente de fragmento como un string si el componente de fragmento existe, en caso contrario se devuelve null.

Ejemplos

Ejemplo #1 Ejemplo básico de Uri\WhatWg\Url::getFragment()

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

echo
$url->getFragment();
?>

El ejemplo anterior mostrará:

foo

Ver también

add a note

User Contributed Notes

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