symfony/polyfill-intl-idn
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
symfony/polyfill-intl-normalizer | v1.28.0 | 41.83 kB | MIT | prod | |
symfony/polyfill-php72 | v1.28.0 | 5.28 kB | MIT | prod |
Symfony Polyfill Intl Idn is a crucial component that provides the functionalities of idn_to_ascii
and idn_to_utf8
functions to users running PHP versions without the Intl (Internationalization) extension. These functions are key in the implementation of internationalized domain names, turning them into Punycode representation (ASCII) and back to Unicode (UTF-8).
To get started with Symfony Polyfill Intl Idn, you need to first install it via Composer:
composer require symfony/polyfill-intl-idn
Once installed, you can use the idn_to_ascii
and idn_to_utf8
functions directly in your PHP code. For instance:
$ascii = idn_to_ascii('bücher.tld');
$utf8 = idn_to_utf8('xn--bcher-kva.tld');
The idn_to_ascii
function converts a Unicode string to an ASCII string, and idn_to_utf8
does the inverse operation, effectively decoding ASCII strings back into Unicode.
The documentation for Symfony Polyfill Intl Idn is integrated within the main Symfony polyfill README, which is accessible on the Symfony Polyfill GitHub page. This document will walk you through a comprehensive overview of the package and how to use it in your PHP applications.