mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #146 from chernjie/SGD
Added SG phone number support
This commit is contained in:
commit
e9391c9d68
@ -140,6 +140,19 @@ class Utils
|
|||||||
|
|
||||||
$phoneNumber = '+'.$countryCode.' ('.$areaCode.') '.$nextThree.'-'.$lastFour;
|
$phoneNumber = '+'.$countryCode.' ('.$areaCode.') '.$nextThree.'-'.$lastFour;
|
||||||
}
|
}
|
||||||
|
else if(strlen($phoneNumber) == 10 && in_array(substr($phoneNumber, 0, 3), array(653, 656, 658, 659))) {
|
||||||
|
/**
|
||||||
|
* SG country code are 653, 656, 658, 659
|
||||||
|
* US area code consist of 650, 651 and 657
|
||||||
|
* @see http://en.wikipedia.org/wiki/Telephone_numbers_in_Singapore#Numbering_plan
|
||||||
|
* @see http://www.bennetyee.org/ucsd-pages/area.html
|
||||||
|
*/
|
||||||
|
$countryCode = substr($phoneNumber, 0, 2);
|
||||||
|
$nextFour = substr($phoneNumber, 2, 4);
|
||||||
|
$lastFour = substr($phoneNumber, 6, 4);
|
||||||
|
|
||||||
|
$phoneNumber = '+'.$countryCode.' '.$nextFour.' '.$lastFour;
|
||||||
|
}
|
||||||
else if(strlen($phoneNumber) == 10) {
|
else if(strlen($phoneNumber) == 10) {
|
||||||
$areaCode = substr($phoneNumber, 0, 3);
|
$areaCode = substr($phoneNumber, 0, 3);
|
||||||
$nextThree = substr($phoneNumber, 3, 3);
|
$nextThree = substr($phoneNumber, 3, 3);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user