PHP code example of philcross / getaddress-php

1. Go to this page and download the library: Download philcross/getaddress-php 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/ */

    

philcross / getaddress-php example snippets


composer 

$response = $client->find($postcode, $propertyNumber);

$longitude = $response->getLongitude();
$latitude  = $response->getLatitude();

foreach ($response->getAddresses() as $address) {
    // ...
}

$response = $client->find('TQ2 6TP', null, false);

// Or if you would prefer to use a named constant to make it easier to read

$response = $client->find('TQ2 6TP', null, Philcross\GetAddress\Responses\Address::SORT_NUMERICALLY);

echo $address->toString();

// You can also cast the object to a string:
echo $address;

Sample Line 1,Sample Line 2,,,Sample Locality,Sample City,Sample County

echo $address->toString(true);

Sample Line 1,Sample Line 2,Sample Locality,Sample City,Sample County

$response = $this->getPrivateAddress('TQ2 6TP');

$response->getAddresses(); // Returns an array

$response = $this->getPrivateAddress('TQ2 6TP', 1);

$response->getAddresses();

$response = $client->addDomainToWhitelist('google.com');

$response->getMessage();
$response->getItems(); // Returns an array

$response = $client->deleteDomainFromWhitelist($id);
$response = $client->deleteIpFromWhitelist($id);

$response = $client->getWhitelistedDomains();
$response = $client->getWhitelistedIpAddresses();

$response = $client->getWhitelistedDomain($id);
$response = $client->getWhitelistedIpAddress($id);

$response = $client->addWebhook('yoursite.com/webhooks/first-limit-reached');

$response = $client->deleteWebhook($id);

$response = $client->getWebhooks();

$response = $client->getWebhook($id);