Skip to content

Instantly share code, notes, and snippets.

@chetanmadaan
Last active March 12, 2020 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chetanmadaan/2c5351725cda2f1cd8984779a3f2c6f5 to your computer and use it in GitHub Desktop.
Save chetanmadaan/2c5351725cda2f1cd8984779a3f2c6f5 to your computer and use it in GitHub Desktop.
Phone Formatted in US format
<?php
if(!empty($phone)) {
$formatedphone = "(" . substr($phone, 0, 3) . ") " . substr($phone, 3, 3) . "-" . substr($phone, 6);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment