Formatting a phone number to use dashes

Assuming that a phone number is from the United States, what is the best way to take a string of numbers like 4809645000 and put it into the format of ###-###-####

?

Thanks!

this should work:

 $nr="4809645000";
echo substr($nr, 0, 3).'-'.substr($nr, 3, 3).'-'.substr($nr, 6, 4);
//should give: 483-964-5000