# Echo formatted phone number

**URL:** <https://forum.kirupa.com/t/echo-formatted-phone-number/330569>\
**Category:** Uncategorized\
**Created:** [February 10, 2013, 3:00pm UTC](https://forum.kirupa.com/t/echo-formatted-phone-number/330569 "2013-02-10T15:00:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nomadster](https://avatars.discourse-cdn.com/v4/letter/n/4bbf92/32.png) [@nomadster](https://forum.kirupa.com/u/nomadster)\
**Post date:** [February 10, 2013, 3:00pm UTC](https://forum.kirupa.com/t/echo-formatted-phone-number/330569/1 "2013-02-10T15:00:29Z")

</div>

[SIZE=2][FONT=arial]Hi - [/FONT]I’m working with php & mysql and have a search [SIZE=2]which displays a record, including a phone number. In the line below, ‘phone’ is the field name. Is there a way I can get the phone number to output formatted as: SIZE=2xxx-xxxx without[SIZE=2] changing the db setup? Is there something I can do in the echo[SIZE=2] line?[/SIZE][/SIZE][/SIZE][/SIZE] I’ve found scripts online, but they’re mostly functions and I can’t figure out how to integrate them into my existing code without [SIZE=2][SIZE=2][SIZE=2]messi[SIZE=2]ng it up[/SIZE][/SIZE][/SIZE][/SIZE].  
[COLOR=#4b0082]echo $results[‘phone’] . “\<br\>”;[/COLOR][/SIZE]  
[SIZE=2][SIZE=2][SIZE=2]If [/SIZE][/SIZE]anyone out there has a fix, would you please share your advice?[SIZE=2] T[/SIZE]hanks.  
nomadster[/SIZE]
