PHP code example of nizerin / kuaidi

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

    

nizerin / kuaidi example snippets


$waybill = new \Kuaidi\Waybill(
    '运单编号', 
    '快递公司名称'
);

(new \Kuaidi\Trackers\Kuaidi100)->track($waybill);
(new \Kuaidi\Trackers\Kuaidiwang)->track($waybill);
(new \Kuaidi\Trackers\Kuaidiniao('Business ID', 'APP Key'))->track($waybill);

// 获取状态,所有状态列表见 `Waybill::STATUS_*` 常量。
$waybill->getStatus();
// 获取详情,支持直接 foreach / while / 数组下标 形式访问。
$waybill->getTraces(); 
bash
php examples/index.php <运单编号> [快递公司名称]