Uri\WhatWg\Url::toAsciiString
PHP function
Edit on GitHub ✎
(PHP 8 >= 8.5.0)
Recompose the URL as an ASCII String
Description
Uri\WhatWg\Url::toAsciiString(): string
Recomposes the URL as an ASCII String, using punycode transcription instead of Unicode characters in the host component.
Parameters Parameters
Return Values
Returns the recomposed URL as an ASCII String.
Examples
Uri\WhatWg\Url::toAsciiString basic example
php
<?php
$url = new \Uri\WhatWg\Url("https://example.com/foo/bar?baz");
echo $url->toAsciiString();
?>The above example will output:
output
https://example.com/foo/bar?bazSee Also
Uri\WhatWg\Url::toUnicodeStringUri\Rfc3986\Uri::toRawStringUri\Rfc3986\Uri::toString