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