PHP code example of baikho / loqate-php

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

    

baikho / loqate-php example snippets


$loqate = new \Baikho\Loqate\Loqate('API Key');

// Simple example.
$result = $loqate->address()->find('foo');

// Advanced example.
$result = (new \Baikho\Loqate\Address\Find('API Key'))
  ->setText('foo')
  ->setIsMiddleWare(TRUE)
  ->setContainer('bar')
  ->setCountries('NL')
  ->makeRequest();

// Simple example.
$result = $loqate->address()->retrieve('XX|XX|XXX|XXXXXXXXXX');

// Advanced example.
$result = (new \Baikho\Loqate\Address\Retrieve('API Key'))
  ->setId('XX|XX|XXX|XXXXXXXXXX')
  ->makeRequest();

$result = $loqate->geocoding()->distance('381600,259400', '380600,25840');
$result = $loqate->geocoding()->distance('51.4733514399,-0.00088499646', '51.492914695,-0.1215161806');
$result = $loqate->geocoding()->distance('SE10 8XJ', 'SW1A 0AA');

$result = $loqate->geocoding()->directions('381600,259400', '380600,25840');
$result = $loqate->geocoding()->directions('51.4733514399,-0.00088499646', '51.492914695,-0.1215161806');
$result = $loqate->geocoding()->directions('SE10 8XJ', 'SW1A 0AA');

$result = $loqate->geocoding()->geocode('GB', 'London');

$result = $loqate->geocoding()->ukFind('London');

$result = $loqate->geocoding()->ukGeocode('London');

$result = $loqate->geocoding()->ukRetrieve('XX|XX|XXX|XXXXXXXXXX');

$result = $loqate->geocoding()->ukReverseGeocode('51.4733514399,-0.00088499646');

$result = $loqate->email()->validate('[email protected]');

$result = $loqate->bankAccount()->validate('XXXXXXXX', 'XX-XX-XX');

$result = $loqate->phone()->validate('1234567890');
$result = $loqate->phone()->validate('1234567890', 'NL');

composer