Skip to content

Commit

Permalink
Added docs for retrieving outward and inward codes
Browse files Browse the repository at this point in the history
  • Loading branch information
DivineOmega authored May 11, 2017
1 parent d32bf03 commit 5faa98c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This library handles various UK postcode related tasks.
* Address lookup by postcode
* Postcode validation
* Generate valid UK postcodes
* Get a postcode's outward and inward codes

## Installation

Expand Down Expand Up @@ -71,3 +72,12 @@ This library allows you generate a random, validate, UK postcode. This makes use
```php
$postcode = \RapidWeb\Postcodes\Utils\Generator::generatePostcode();
```

### Get outward and inward codes

> The first part of the Postcode eg PO1 is called the outward code as it identifies the town or district to which the letter is to be sent for further sorting. The second part of the postcode eg 1EB is called the inward code.
```php
$outwardCode = \RapidWeb\Postcodes\Utils\Tokenizer::outward('ST163JR'); // Returns ST16
$inwardCode = \RapidWeb\Postcodes\Utils\Tokenizer::outward('ST163JR'); // Returns 3JR
```

0 comments on commit 5faa98c

Please sign in to comment.