this number - +77771233212
to this - +7 (777) 123-3212
<?php $num = '+77771233212'; echo substr($num, 0, 2) . ' (' . substr($num, 2, 3) . ') ' . substr($num, 5, 3) . '-' . substr($num, 8, 4);
https://stackoverflow.com/questions/4708248/formatting-phone-numbers-in-php
Great, the first sloution is very clean.
Обсуждают сегодня