2017 © Pedro Peláez
 

library uk-postcodes

UK postcode validation and reverse geocoding via postcodes.io and php

image

codescheme/uk-postcodes

UK postcode validation and reverse geocoding via postcodes.io and php

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

UK Postcodes

Latest Version on Packagist ![Software License][ico-license] Build Status ![Total Downloads][ico-downloads], (*1)

A php API client for the methods at postcodes.io - useful for UK postcode validation and reverse geocoding: that is, determining postcode from lat, long coordinates. No fiddling around with api keys or authentication necessary..., (*2)

With thanks to https://postcodes.io, (*3)

Install

Via Composer, (*4)

``` bash $ composer require codescheme/uk-postcodes, (*5)


## Basic Usage Return data for a given postcode ```php use Codescheme\Ukpostcodes\Postcode; $client = new Postcode(); $results = $client->postcodeLookup('SE21 8JL'); if ($results->status === 200) { print_r($results); }

Methods

->validate('SE31 9AX'); //returns boolean
->postcodeLookup('SE21 8JL');
->nearest('SE21 8JL');
->reverseGeocode(-0.397913, 51.44015); // lng,lat
->autocomplete('RG1 3');
->outcodeLookup('SE21');

$postcodes = ['OX49 5NU', 'M32 0JG', 'NE30 1DP'];
->postcodeLookupBulk($postcodes);

$coordinates = [
    ['longitude' =>  0.629834723775309, 'latitude' => 51.7923246977375],
    ['longitude' => -2.49690382054704,  'latitude' => 53.5351312861402]
    ];
->reverseGeocodeBulk($coordinates);

Testing

bash $ composer test, (*6)

License

The MIT License (MIT). Please see License File for more information., (*7)

The Versions

20/02 2017

dev-master

9999999-dev https://github.com/codescheme/uk-postcodes

UK postcode validation and reverse geocoding via postcodes.io and php

  Sources   Download

MIT

The Requires

 

The Development Requires

geocoding postcodes uk

20/02 2017

v1.0

1.0.0.0 https://github.com/codescheme/uk-postcodes

UK postcode validation and reverse geocoding via postcodes.io and php

  Sources   Download

MIT

The Requires

 

The Development Requires

geocoding postcodes uk