Skip to content

Uri: getPath Example

Terry L edited this page Jun 20, 2020 · 3 revisions

Shieldon\Psr7\Uri

getPath

Retrieve the path component of the URI.

  • return string

Example:

$uri = new \Shieldon\Psr7\Uri(
    'https://example.com/post/?p=113&foo=bar#yes-i-do'
);

echo $uri->getPath();
// Outputs: /post/
Clone this wiki locally