If no country code is entered display the number only no spaces hyphens or perenthesis

This commit is contained in:
johnnyq 2025-03-30 12:22:43 -04:00
parent 98bb65509d
commit 42606067c0
1 changed files with 1 additions and 6 deletions

View File

@ -320,12 +320,7 @@ function formatPhoneNumber($phoneNumber, $country_code = '', $show_country_code
break;
}
// Fallback if formatting failed
if (!$formatted && strlen($digits) >= 7) {
$formatted = substr($digits, 0, 3) . ' ' . substr($digits, 3, 3) . ' ' . substr($digits, 6);
}
// Still no formatting? Use raw digits
// no formatting? Use raw digits
if (!$formatted) {
$formatted = $digits ?: $phoneNumber; // Use original input if digits are empty
}