Home > Article > Backend Development > Example of using PHP express tracking number query interface_PHP tutorial
Through this interface, you can query express tracking information such as YTO Express, STO Express, EMS Express, Yunda Express, etc. No additional development is required, which is very convenient
First, register an account on www.aikuaidi.cn and use key !
require(dirname(__FILE__) . '/includes/init.php');
if ($id = intval($_REQUEST['id'])) {
$sql_select = 'SELECT consignee,mobile,tel,tracking_sn,shipping_code,shipping_name FROM '.
$GLOBALS['ecs ']->table('order_info')." WHERE order_id=$id";
$order_info = $GLOBALS['db']->getRow($sql_select);
// Express company code mapping
$shipping_code = array (
'ems' => 'ems',
'ems2' => 'ems',
'sto_express' = > 'zjs',
'sto_nopay' => 'zjs',
'zto' => 'zhongtong',
'sto' => 'shentong',
'yto ' 'sf' => 'yuantong',
'emssn' => 'ems',
'sf2' => ; 'shunfeng',
'yunda' => 'yunda',
);
$aikuaidi_key = 'xxxxxxx';
$logistics_info = file_get_contents($logistics_url);
//var_dump($logistics_info);
< span>Contact number:{$order_info['mobile']} // {$order_info['tel']}
Delivery: < strong>{$order_info['shipping_name']}
EOF;
echo $logistics_info;
echo "
Click me click me";
//exit;
}
www.bkjia.com