Uri\Rfc3986\Uri::getQuery
PHP function
Edit on GitHub ✎
(PHP 8 >= 8.5.0)
Retrieve the normalized query component
Description
Uri\Rfc3986\Uri::getQuery(): string|null
Retrieves the normalized query component.
Parameters Parameters
Return Values
Returns the normalized query component as a String if the query component exists, null is returned otherwise.
Examples
Uri\Rfc3986\Uri::getQuery basic example
php
<?php
$uri = new \Uri\Rfc3986\Uri("https://example.com?foo=bar");
echo $uri->getQuery();
?>The above example will output:
output
foo=barSee Also
Uri\Rfc3986\Uri::getRawQueryUri\Rfc3986\Uri::withQueryUri\WhatWg\Url::getQuery