2017 © Pedro Peláez
 

library uk-counties

A PHP list of UK counties

image

adamb/uk-counties

A PHP list of UK counties

  • Thursday, March 1, 2018
  • by AdamBinnersley
  • Repository
  • 1 Watchers
  • 0 Stars
  • 701 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 93 % Grown

The README.md

Build Status Scrutinizer Quality Score Minimum PHP Version Scrutinizer Coverage, (*1)

UK Counties PHP

Produces a list of UK counties using PHP. Can be used to store county ID's rather than names., (*2)

Installation

Installation is available via Composer/Packagist, you can add the following line to your composer.json file:, (*3)

"adamb/uk-counties": "^1.0"

or, (*4)

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., (*5)

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., (*6)

<?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"

The Versions

01/03 2018

dev-master

9999999-dev

A PHP list of UK counties

  Sources   Download

MIT

The Development Requires

01/03 2018

v1.0.1

1.0.1.0

A PHP list of UK counties

  Sources   Download

MIT

The Development Requires

24/02 2018

v1.0.0

1.0.0.0

A PHP list of UK counties

  Sources   Download

MIT

The Development Requires