PHP is great. It complements JavaScript wonderfully. You may have already formatted the phone number on the front end, but what about on the backend? There comes a time when you need to use php to format a phone number (php format phone number). I use this function in my projects all the time.
PHP Format Phone Number Function
How to use php format telephone number:
function format_phone($country, $phone) { $function = ‘format_phone_’ . $country; if(function_exists($function)) { return $function($phone); } return $phone; } function format_phone_us($phone) { // note: making sure we have something if(!isset($phone{3})) { return ”; } // note: