Uri\WhatWg\Url::getPassword
PHP function
Edit on GitHub ✎
(PHP 8 >= 8.5.0)
Retrieve the password component
Description
Uri\WhatWg\Url::getPassword(): string|null
Retrieves the password component.
Parameters Parameters
Return Values
Returns the password component as a String if the password component exists, null is returned otherwise.
Examples
Uri\WhatWg\Url::getPassword basic example
php
<?php
$url = new \Uri\WhatWg\Url("https://user:password@example.com");
echo $url->getPassword();
?>The above example will output:
output
passwordSee Also
Uri\WhatWg\Url::withPasswordUri\Rfc3986\Uri::getRawPasswordUri\Rfc3986\Uri::getPassword