如何在php中列出所有国家及其州/省?

6 php list countries

是否有任何快速指南/参考列出所有国家及其州/省?

就像我点击美国一样,它会列出:阿拉巴马州,阿拉斯加州等

Ali*_*xel 8

pycountry是我能找到的最完整的免费参考:

pycountry provides the ISO databases for the standards:

639 Languages
3166 Countries
3166-2 Subdivisions of countries
4217 Currencies
15924 Scripts

The databases are imported from Debian's pkg-isocodes, packaged into pycountry and made accessible through a Python API.

Translation files for the various strings are included as well.
Run Code Online (Sandbox Code Playgroud)


beg*_*ggs 3

我没有代码可以做到这一点,但如果您想要世界上大部分地区的行政区的良好(免费)列表,您可以使用维基百科页面。

  • 从维基百科复制信息并不构成盗窃。正如维基百科 TOS 中所述:“您可以自由地重复使用维基媒体项目的内容,但根据“合理使用”豁免或版权法的类似豁免使用的内容除外”(请参阅​​:http://wikimediafoundation. org/wiki/Terms_of_Use 了解更多信息)至于 randy melder 的答案,用户将其发布以供其他人使用,并且它是根据免费分发给所有人使用的 ISO 数据生成的。 (2认同)