Documentation for crwlr / url (v1.2)

Attention: You're currently viewing the documentation for v1.2 of the url package.
This is not the latest version of the package.
If you didn't navigate to this version intentionally, you can click here to switch to the latest version.

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