Uri\WhatWg\Url::getPath
PHP function
Edit on GitHub ✎
(PHP 8 >= 8.5.0)
Retrieve the path component
Description
Uri\WhatWg\Url::getPath(): string
Retrieves the path component.
Parameters Parameters
Return Values
Returns the path component as a String.
Examples
Uri\WhatWg\Url::getPath basic example
php
<?php
$url = new \Uri\WhatWg\Url("https://example.com/foo/bar");
echo $url->getPath();
?>The above example will output:
output
/foo/barSee Also
Uri\WhatWg\Url::withPathUri\Rfc3986\Uri::getRawPathUri\Rfc3986\Uri::getPath