Skip to content

Uri: getPort Example

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

Shieldon\Psr7\Uri

getPort()

Retrieve the port component of the URI.

  • return int|null

Example:

$uri = new \Shieldon\Psr7\Uri(
    'https://terry:[email protected]:8888/phpMyAdmin/'
);

echo $uri->getPort();
// Outputs: 8888
Clone this wiki locally