Uri\WhatWg\Url::toAsciiString

(PHP 8 >= 8.5.0)

Uri\WhatWg\Url::toAsciiStringURL を ASCII string として再構築する

説明

public Uri\WhatWg\Url::toAsciiString(): string

ホストコンポーネントで Unicode 文字ではなく Punycode による変換を使用して、URL を ASCII string として再構築します。

パラメータ

この関数にはパラメータはありません。

戻り値

再構築された URL を ASCII string として返します。

例1 Uri\WhatWg\Url::toAsciiString() の基本的な例

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

echo
$url->toAsciiString();
?>

上の例の出力は以下となります。

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

参考