We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ebafa27 commit 5eebc54Copy full SHA for 5eebc54
src/Util.php
@@ -888,10 +888,10 @@ public static function unzip($zip_file, $extract_path = null) {
888
} return false;
889
}
890
891
- public static function format_phone($input) {
+ public static function format_phone($input, $country_code = 1) {
892
$clean_input = substr(preg_replace('/\D+/i', '', $input), -10);
893
if (preg_match('/^(\d{3})(\d{3})(\d{4})$/', $clean_input, $matches)) {
894
- $result = '+1 ('.$matches[1].') '.$matches[2].'-'.$matches[3];
+ $result = '+'.$country_code.' ('.$matches[1].') '.$matches[2].'-'.$matches[3];
895
return $result;
896
897
0 commit comments