If no country code is entered display the number only no spaces hyphens or perenthesis
This commit is contained in:
@@ -320,12 +320,7 @@ function formatPhoneNumber($phoneNumber, $country_code = '', $show_country_code
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback if formatting failed
|
// no formatting? Use raw digits
|
||||||
if (!$formatted && strlen($digits) >= 7) {
|
|
||||||
$formatted = substr($digits, 0, 3) . ' ' . substr($digits, 3, 3) . ' ' . substr($digits, 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Still no formatting? Use raw digits
|
|
||||||
if (!$formatted) {
|
if (!$formatted) {
|
||||||
$formatted = $digits ?: $phoneNumber; // Use original input if digits are empty
|
$formatted = $digits ?: $phoneNumber; // Use original input if digits are empty
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user