PHP code example of slince / shipment-tracking-ems

1. Go to this page and download the library: Download slince/shipment-tracking-ems 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/ */

    

slince / shipment-tracking-ems example snippets



$tracker = new Slince\ShipmentTracking\EMS\EMSTracker(AUTHENTICATE, 'en');

try {
   $shipment = $tracker->track('CNAQV100168101');
   
   print_r($shipment->getEvents());  //print the shipment events
   
} catch (Slince\ShipmentTracking\Exception\TrackException $exception) {
    exit('Track error: ' . $exception->getMessage());
}