Last active
March 12, 2020 18:34
-
-
Save chetanmadaan/2c5351725cda2f1cd8984779a3f2c6f5 to your computer and use it in GitHub Desktop.
Phone Formatted in US format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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