-
Notifications
You must be signed in to change notification settings - Fork 1
Uri: withPort Example
Terry L edited this page Jun 20, 2020
·
3 revisions
Shieldon\Psr7\Uri
Return an instance with the specified port.
-
param
int|nullport*The port to use with the new instance; a null value removes the port information. -
return
static
Example:
echo $uri->getPort();
// Outputs: 8888
$uri = $uri->withPort(443);
echo $uri->getPort();
// Outputs: 443
$uri = $uri->withPort(null);
echo $uri->getPort();
// Outputs:composer require shieldon/psr-httpShieldon PSR HTTP implementation written by Terry L. from Taiwan.
