PHP code example of nickcheek / uspslookup

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

    

nickcheek / uspslookup example snippets


use \Nickcheek\USPSLookup\USPSLookup;

$lookup = new \Nickcheek\USPSLookup\USPSLookup('XXXXXXXXX');
$find = $lookup->Address()->cityState('72019');


$zips = array('72204','72203');
$lookup = new \Nickcheek\USPSLookup\USPSLookup('XXXXXXXXX');
$find = $lookup->Address()->cityState($zips);

 
$lookup = new \Nickcheek\USPSLookup\USPSLookup('XXXXXXXXX');
$find = $lookup->Address()->zipCode('1234 Anystreet','','Little Rock','AR');
	   

$lookup = new \Nickcheek\USPSLookup\USPSLookup('XXXXXXXXX');
$find = $lookup->Price()->getRate('72204','37501','1','3','Priority');

 php
$lookup = new USPSLookup('XXXXXXXXX');
$response = $lookup->Address()->verify('123 Anystreet','','Little Rock','AR','72204');

var_dump($response);

 php
$lookup = new \Nickcheek\USPSLookup\USPSLookup('XXXXXXXXX');
$find = $lookup->verify($address,$address2,$city,$state,$zip);

 php
$lookup = new \Nickcheek\USPSLookup\USPSLookup('XXXXXXXXX');
$find = $lookup->Tracking()->track('9405511206019825745000');

 php
$lookup = new \Nickcheek\USPSLookup\USPSLookup('XXXXXXXXX');
$track = array("9405511206019825745000","9405511206019825304382");
$find = $lookup->Tracking()->trackMultiple($track);