Uri\WhatWg\Url::getAsciiHost
PHP function
Edit on GitHub ✎
(PHP 8 >= 8.5.0)
Retrieve the host component as an ASCII String
Description
Uri\WhatWg\Url::getAsciiHost(): string|null
Retrieves the host component as a String using punycode transcription instead of Unicode characters.
Parameters Parameters
Return Values
Returns the host component as an ASCII String if the host component exists, null is returned otherwise.
Examples
Uri\WhatWg\Url::getAsciiHost basic example
php
<?php
$url = new \Uri\WhatWg\Url("https://example.com");
echo $url->getAsciiHost();
?>The above example will output:
output
example.comSee Also
Uri\WhatWg\Url::getUnicodeHostUri\WhatWg\Url::withHostUri\Rfc3986\Uri::getRawHostUri\Rfc3986\Uri::getHost