PHP code example of yuxiaoyang / expresscheck

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

    

yuxiaoyang / expresscheck example snippets


//Illuminate\Hashing\HashServiceProvider::class,

Yuxiaoyang\ExpressCheck\ExpressCheckProvider::class,





use \Yuxiaoyang\ExpressCheck\ExpressCheck;

class ExpressCheckController extends Controller
{
    
    public $expresscheck;

    //快递单号查询
    public function expresscheck()
    {
        //创建示例对象
	//$this->expresscheck = new \Yuxiaoyang\ExpressCheck\ExpressCheck();
        $this->expresscheck = new ExpressCheck();
        $expressNum = "30000029654217";
        $data = $this->expresscheck->search($expressNum);
        return $data;
    }


}

不传递快递公司代码时,会自动判断快递单号所属快递公司,默认返回json.