Usage
Country Flag SVG (optional)
Example response
Available Functions
Function | Description |
---|---|
| get all available countries |
| find country by ISO 3166-1 alpha-2 |
| find countries by ISO 3166-1 alpha-2 |
| find country by dial code Eg. |
| find countries by dial code Eg. |
| find countries with keyword Eg. |
| group countries by the first letter of their name |
getAll()
, findByKeyword()
, findByCountryCode()
functions support filter option for secondary dial codes. As a default withSecondary
is true
. withSecondary
with true option will return list of dial codes available for specific country.
Example.
Country
Function / Attribute | Description |
---|---|
| format phone number with dial code, second param accept |
| get name attr from country |
| get name dial code from country |
| get code attr from country |
| get flag emoji attr from country |
| get preferred attr from country |
Sample Usage of formatPhoneNumber()
From version 5.0, you will need to pass PhoneNumberUtil instance to Country list instance using setPhoneNumberUtil
formatPhoneNumber()
use google-libphonenumber
package. For more information about the package, please visit to original documentation.
Last updated