adamb/uk-counties
Composer 安装命令:
composer require adamb/uk-counties
包简介
A PHP list of UK counties
README 文档
README
UK Counties PHP
Produces a list of UK counties using PHP. Can be used to store county ID's rather than names.
Installation
Installation is available via Composer/Packagist, you can add the following line to your composer.json file:
"adamb/uk-counties": "^1.0"
or
composer require adamb/uk-counties
License
This software is distributed under the MIT license. Please read LICENSE for information on the software availability and distribution.
Usage
List Counties
<?php use UKCounties\Counties; print_r(Counties::getCounties()); // Returns array of counties e.g. array(1 => 'Bedfordshire', 2 => 'Berkshire', 3 => 'Bristol', etc, etc, etc) // To list the counties in alphabetical order you can use getCountiesByName() instead of getCounties() print_r(Counties::getCountiesByName()); // Returns same as above but in alphabetical order
Get County ID By Name
This can be used to store a unique county ID in a database rather than duplicating information.
<?php use UKCounties\Counties; echo(Counties::getCountyID('West Yorkshire')); // Returns 46 echo(Counties::getCountyID('Aberdeenshire')); // Returns 60
Get County Name By ID
<?php use UKCounties\Counties; echo(Counties::getCountyName(46)); // Returns "West Yorkshire" echo(Counties::getCountyName(60)); // Returns "Aberdeenshire"
统计信息
- 总下载量: 2.72k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-24