Documentation for crwlr / url (v1.2)

Handling Internationalized domain names (IDN)

echo Url::parse('https://www.пример.онлайн/hello/world')->toString();



Behind the curtains symfony/polyfill-intl-idn is used, so you don't need to have the internationalization PHP extension installed to parse internationalized domain names.

To check if a url contains an internationalized domain name you can use the hasIdn method:

Url::parse('')->hasIdn();           // => false
Url::parse('https://www.mü')->hasIdn();             // => true
Url::parse('')->hasIdn();   // => true