📜 ⬆️ ⬇️

Warm up

Hello! We decided to arrange for you a small programmer competition with a prize. The essence of the competition: solve the puzzle, which is laid out below. The prize is a gift certificate from REG.RU Registrar in the amount of 1,000 rubles. The winner can not refuse anything to himself;)

So let's get started. Since REG.RU deals with domains and hosting, the task will be specific:
Write a mini-manual (sample code) for converting domain names to / from Punycode from PHP. Source encoding: cp1251 or utf8 (optional). You can use third-party open libraries.

The task, as you understand, does not have one answer, there may be many options. Therefore, the winner will be the one who offers the best solution. The optimal is the most efficient, reliable, understandable and concise. Evaluate decisions will be technical specialists REG.RU.
')
Write solutions right here in the comments. Everything is open and transparent here. And in order not to delay the process, let's set the deadline for accepting the results before 20.00 today (really a task for half an hour). After this time, we draw the line and the next day we announce the winner, who will solemnly activate a gift certificate in the amount of 1 000 rubles to a personal account in REG.RU for ordering any services;)

PS If a winning decision is offered by several contestants, the winner will be the one who posted the decision first. In fairness.

Source: https://habr.com/ru/post/92128/


All Articles