-
Notifications
You must be signed in to change notification settings - Fork 1
Uri: withUserInfo Example
Terry L edited this page Jun 20, 2020
·
4 revisions
Shieldon\Psr7\Uri
Return an instance with the specified user information.
-
param
string
user*
The user name to use for authority. -
param
string|null
password= null
The password associated with $user. -
return
static
Example:
echo $uri->getUserInfo();
// Outputs: terry:1234
$url = $uri->withUserInfo('jack', '5678');
echo $uri->getUserInfo();
// Outputs: jack:5678
composer require shieldon/psr-http
Shieldon PSR HTTP implementation written by Terry L. from Taiwan.