Hello.
It was necessary to make a functional transfer of the domain to Christmas trees-with-delivery. RF in such xn ----- 8kciivmbgc2bd6adp4u.xn - p1ai
How to do this in PHP?
Hello.
It was necessary to make a functional transfer of the domain to Christmas trees-with-delivery. RF in such xn ----- 8kciivmbgc2bd6adp4u.xn - p1ai
How to do this in PHP?
as advised by @Etki, you should use the idn_to_ascii function (inverse transform: idn_to_utf8 ).
it is likely that we are talking about a server running the gnu / linux operating system. there you need to install the php5-intl
package ( php-idn
, etc.) containing the implementation of these functions.
example:
$ php -r "echo idn_to_ascii('домен.рф');" xn--d1acufc.xn--p1ai $ php -r "echo idn_to_utf8('xn--d1acufc.xn--p1ai');" домен.рф
Most often advised to use third-party classes. For example, there is such an example .
Source: https://ru.stackoverflow.com/questions/429226/
All Articles