1. 程式人生 > >國際化手機號碼輸入外掛yii2-phone-input使用參考(獲得國家程式碼)

國際化手機號碼輸入外掛yii2-phone-input使用參考(獲得國家程式碼)

https://github.com/Borales/yii2-phone-input


$("#phone").on("countrychange", function(e, countryData) {
  // do something with countryData
});

When the countrychange event fires, countryData will contain an object with the country data:

{
    "name": "United States",
    "iso2": "us",
    "dialCode": "1",
    "priority": 0,
    "areaCodes": null
}


參考地址:


https://stackoverflow.com/questions/48446511/getting-country-code-through-form-in-php-intl-tel