iPixel Posted June 10, 2009 Share Posted June 10, 2009 The only problem is im not quite sure what functions to use to achieve this. Originally i though explode would do the trick but there are no separators so i dunno how else i can. I start with retreiving a # that looks like this 9998887777 and i need to convert it to looks like (999) 888 - 7777 Thanks! Link to comment https://forums.phpfreaks.com/topic/161664-solved-simple-question-about-converting-phone-numbers/ Share on other sites More sharing options...
RussellReal Posted June 10, 2009 Share Posted June 10, 2009 <?php $number = '9998887777'; echo '('.substr($number,0,3).') '.substr($number,3,3).' - '.substr($number,6,4); ?> Link to comment https://forums.phpfreaks.com/topic/161664-solved-simple-question-about-converting-phone-numbers/#findComment-853028 Share on other sites More sharing options...
iPixel Posted June 10, 2009 Author Share Posted June 10, 2009 Awesome! Thank You Very Much! Link to comment https://forums.phpfreaks.com/topic/161664-solved-simple-question-about-converting-phone-numbers/#findComment-853033 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.