php8.5
Home/ Manual/ whatwg / url/ Uri\WhatWg\Url::toUnicodeString

Uri\WhatWg\Url::toUnicodeString

PHP function Edit on GitHub ✎

(PHP 8 >= 8.5.0)

Recompose the URL as a Unicode String

Description

Uri\WhatWg\Url::toUnicodeString(): string

Recomposes the URL as a String, where the host component may contain Unicode characters.

Parameters Parameters

Return Values

Returns the recomposed URL as a Unicode String.

Examples

Uri\WhatWg\Url::toUnicodeString basic example

php
<?php
$url = new \Uri\WhatWg\Url("https://example.com/foo/bar?baz");

echo $url->toUnicodeString();
?>

The above example will output:

output
https://example.com/foo/bar?baz

See Also

  • Uri\WhatWg\Url::toAsciiString
  • Uri\Rfc3986\Uri::toRawString
  • Uri\Rfc3986\Uri::toString

Source: reference/uri/uri/whatwg/url/tounicodestring.xml · from the official PHP manual (php/doc-en)