category OSS
package OSS_Log
copyright Copyright (c) 2007 - 2012, Open Source Solutions Limited, Dublin, Ireland
license New BSD License

 Methods

Converts a phone number to its international format, adding the intl.

formatPhoneNumber(string $pNumber, bool $pInternational, string | int $pCountryCode, string | int $pLocalPrefix) : string
Static

country code to the beginning, and removing the leading local prefix if present - for example '353' and '0' for Ireland.

Parameters

$pNumber

string

$pInternational

bool

default false

$pCountryCode

stringint

default '353'

$pLocalPrefix

stringint

default '0'

Returns

string

Converts a phone number to its international format, adding the intl.

intlPhoneNumber(string $pNumber, string | int $pCountryCode, string | int $pLocalPrefix) : string
Static

country code to the beginning, and removing the leading local prefix if present - for example '353' and '0' for Ireland.

Parameters

$pNumber

string

$pCountryCode

stringint

default '353'

$pLocalPrefix

stringint

default '0'

Returns

string

Returns true if the passed phone number is a mobile number.

isMobileNumber(string $pNumber, string $pCountryCode) : boolean
Static

Parameters

$pNumber

string

$pCountryCode

string

default '353'

Returns

boolean

Converts a phone number to its national format, stripping the intl.

localPhoneNumber(string $pNumber, string | int $pCountryCode, string | int $pLocalPrefix) : string
Static

country code from the beginning, and adding the leading local prefix if missing - for example '353' and '0' for Ireland.

Parameters

$pNumber

string

$pCountryCode

stringint

default '353'

$pLocalPrefix

stringint

default '0'

Returns

string