PHP code example of wander / express
1. Go to this page and download the library: Download wander/express 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/ */
wander / express example snippets
# 在项目中加载初始化文件
// 参考https://m.baidu.com/s?word=快递
try {
$number = 'YT5744661853493';
//cookie存放路径
$cookiePath = __DIR__ . '/cookie';
//错误重试次数
$tryTimes = 3;
//ip地址
$ip = '101.69.230.179';
$express = new \Express\Express($cookiePath, $ip, $tryTimes);
//取快递公司列表
$res = $express->getExpressList();
print_r($res);
//取快递物流信息
$res = $express->express($number);
print_r($res);
} catch (\Exception $e) {
echo $e->getMessage();
}