jansenfelipe/cidades-gratis

使用此包,您可以免费直接在 IBGE 网站上查询城市。

v1.0.0 2015-08-20 21:55 UTC

This package is auto-updated.

Last update: 2024-08-29 04:36:54 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version MIT license

使用此包,您可以免费直接在 IBGE 网站上查询城市。

如何使用

添加库

$ composer require jansenfelipe/cidades-gratis

将 composer 的 autoload.php 文件添加到您的 PHP 文件中。

require_once 'vendor/autoload.php';  

方法

查找省/自治区

使用 getUfs() 方法返回具有相应代码的省/自治区列表

$ufs = JansenFelipe\CidadesGratis\Cidades::getUfs();
查找城市

使用 getCidades() 方法返回具有相应代码的特定省/自治区的城市列表

$cidades = JansenFelipe\CidadesGratis\Cidades::getCidades(31);
查找城市的详细信息

使用 getCidadeDetalhes() 方法返回特定城市的详细信息

$detalhes = JansenFelipe\CidadesGratis\Cidades::getCidadeDetalhes(310620);

构建

build/ 文件夹中存在两个文件:ufs.jsoncidades.json。它们是在 2015 年 8 月 20 日生成的

喜欢吗?还了解以下内容

许可证

MIT 许可证 (MIT)