#what3words php-wrapper
Use the what3words API in your PHP site (see http://developer.what3words.com/api)
This function takes either:
- a string of 3 words
'table.book.chair'
- an array of 3 words
['table', 'book', 'chair']
And returns
- an array of 2 coordinates
[0.1234, 1.5678]
This function takes either:
- a string of 2 positions
'0.1234, 1.5678'
- an array of 2 positions
[0.1234, 1.5678]
And returns
- an array of 3 words
['table', 'book', 'chair']
This function sets the classes' language, and takes a 2 letter language string:
setLanguage('fr');
<?php
$w3w = new what3words('YOURAPIKEY');
$result = $w3w->wordsToPosition('table.book.chair');
print_r($result);
<?php
$w3w = new what3words('YOURAPIKEY');
$result = $w3w->positionToWords('51.484463, -0.195405');
print_r($result);