定制 agallou/departements 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

agallou/departements

最新稳定版本:v0.1.0

Composer 安装命令:

composer require agallou/departements

包简介

Liste des départements Français

README 文档

README

Utilisation

Récupération d'un libellé :

$departements = new \agallou\Departements\Collection();
var_dump($departements->getLabel('29'));
//string(10) "Finistère"

Récupération tableau complet :

$departements = new \agallou\Departements\Collection();
var_dump($departements->getAll());

Récupération d'un libellé si le paramète n'est pas paddé avec un zéro :

$departements = new \agallou\Departements\Collection();
var_dump($departements->getLabel(1, true));
//string(3) "Ain"

La collection implémente ArrayIterator, il est donc possible de boucler dessus :

$departements = new \agallou\Departements\Collection();
foreach ($departements as $code => $label) {
  var_dump($code, $label);
}
//string(2) "01"
//string(3) "Ain"
//string(2) "02"
//string(5) "Aisne"
//...
//string(7) "Mayotte"

Il est aussi possibler d'accéder aux libellés comme ceci :

$departements = new \agallou\Departements\Collection();
var_dump($departements['69']);
//string(6) "Rhône"

统计信息

  • 总下载量: 1.99k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-02-01