PHP code example of flashmatt / postcodesio
1. Go to this page and download the library: Download flashmatt/postcodesio library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
flashmatt / postcodesio example snippets
$response->getStatusCode();
$response->getHeaders();
$response->getHeader('Content-Type');
$response->getBody();
php
$postcode = json_decode($response->getBody())->postcode;
// OR
$latitude = json_decode($response->getBody())->latitude;