Uri\WhatWg\Url::getQuery

(PHP 8 >= 8.5.0)

Uri\WhatWg\Url::getQueryRetrieve the query component

Beschreibung

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

Retrieves the query component.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Returns the query component as a String if the query component exists, null is returned otherwise.

Beispiele

Beispiel #1 Uri\WhatWg\Url::getQuery() basic example

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

echo $url->getQuery();
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

foo/bar

Siehe auch