PHP code example of afiqiqmal / parcel-track

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

    

afiqiqmal / parcel-track example snippets




$data = parcel_track()
	->postLaju()
	->setTrackingNumber("ER157080065MY")
	->fetch();

$data = parcel_track()
	->gdex()
	->setTrackingNumber("4941410530")
	->fetch();

$data = parcel_track()
	->abxExpress()
	->setTrackingNumber("EZP843055940197")
	->fetch();

$data = parcel_track()
	->dhlExpress()
	->setTrackingNumber("5176011131")
	->fetch();

$data = parcel_track()
	->setTrackingNumber("5176011131")
	->checkCourier();
json
{
    "code": 200,
    "error": false,
    "tracker": {
        "tracking_number": "4941410530",
        "provider": "gdex",
        "delivered": true,
        "checkpoints": [
            {
                "date": "2016-11-30 17:41:10",
                "timestamp": 1480527670,
                "process": "Outbound from KBR station",
                "type": "item_received",
                "event": "Kota Bharu"
            },
            {
                "date": "2016-11-30 17:47:00",
                "timestamp": 1480528020,
                "process": "Picked up by courier",
                "type": "dispatch",
                "event": "Kota Bharu"
            },
            {
                "date": "2016-12-01 03:25:11",
                "timestamp": 1480562711,
                "process": "In transit",
                "type": "facility_process",
                "event": "Petaling Jaya"
            },
            {
                "date": "2016-12-01 10:00:16",
                "timestamp": 1480586416,
                "process": "Inbound to JHB station",
                "type": "facility_process",
                "event": "Johor Bharu"
            },
            {
                "date": "2016-12-02 10:10:00",
                "timestamp": 1480673400,
                "process": "Delivered",
                "type": "delivered",
                "event": "Sungai Tiram"
            }
        ]
    },
    "generated_at": "2018-05-03 02:07:20",
    "footer": {
        "source": "GD Express Sdn Bhd",
        "developer": {
            "name": "Hafiq",
            "homepage": "https://github.com/afiqiqmal"
        }
    }
}