Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 1010 Bytes

File metadata and controls

44 lines (32 loc) · 1010 Bytes

Rhymix\Framework\i18n

listCountries()

public static function listCountries(int $sort_by = 6): array

Get the list of all countries.

getCallingCodeByCountryCode()

public static function getCallingCodeByCountryCode(string $code): ?string

Get the calling code from a country code (either ISO-3166-1 alpha2 or alpha3). This function returns null if a matching country is not found.

getCountryCodeByCallingCode()

public static function getCountryCodeByCallingCode(
    string $code,
    $type = 3
): ?string

Get the country code (either ISO-3166-1 alpha2 or alpha3) from a calling code. This function may return the wrong country if two or more countries share a calling code. This function returns null if a matching country is not found.

formatPhoneNumber()

public static function formatPhoneNumber(
    string $phone_number,
    string $phone_country,
    bool $pretty = true
): string

Format a phone number with country code.