Note that in this version, if the number was entered originally using alpha characters and
this version of the number is stored in raw_input, this representation of the number will be
used rather than the digit representation. Grouping information, as specified by characters
such as "-" and " ", will be retained.
Caveats:
- This will not produce good results if the country calling code is both present in the raw input _and_ is the start of the national number. This is not a problem in the regions which typically use alpha numbers.
- This will also not produce good results if the raw input has any grouping information within the first three digits of the national number, and if the function needs to strip preceding digits/words in the raw input before these digits. Normally people group the first three digits together so this is not a huge problem - and will be fixed if it proves to be so.
public formatOutOfCountryKeepingAlphaChars ( |
||
$number | the phone number that needs to be formatted | |
$regionCallingFrom | String | the region where the call is being placed |
return | String | the formatted phone number |