PHP code example of buibr / hlrlookup

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

    

buibr / hlrlookup example snippets


use buibr\HLR\Single;

$config = new buibr\HLR\HlrApi(['apikey'=>'','password'=>'']);
$lookup = new Single( $config );
$object = $lookup->check('38971789062');

use buibr\HLR\Bulk;

$config = new HlrApi(['apikey'=>'','password'=>'']);
$lookup = new Bulk( $config );

$batch      = $lookup->submit(true, ['38971789062', '38971789062', '38971789062']);

while(true){

    $status     = $lookup->status($batch);

    if($status->getStatus() === 'complete'){
        $download   = $lookup->download($batch);

        foreach($download->getData() as $record) {
            ....
        }

        break;
    }

    sleep(1);
}