ahmard / geodata
一个简单的类,提供访问国家与州列表的功能。
0.0.3
2022-06-17 21:28 UTC
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2024-09-18 02:42:01 UTC
README
一个简单的类,提供访问国家与州列表的功能。
安装
composer require ahmard/geodata
使用
获取国家列表
<?php use Ahmard\GeoData\Country; require __DIR__ . '/vendor/autoload.php'; $countries = Country::all(); var_dump($countries);
通过电话区号获取国家
<?php use Ahmard\GeoData\Country; require __DIR__ . '/vendor/autoload.php'; $countryInfo = Country::getByPhoneCode(234); var_dump($countryInfo);
获取国家州列表
<?php use Ahmard\GeoData\Country; require __DIR__ . '/vendor/autoload.php'; $states = Country::getStates(160); var_dump($states);