PHP express delivery number query source code_PHP tutorial
Jul 13, 2016 am 10:29 AMPost and record the source code of PHP query for express tracking number. It can query the express tracking number records of various express delivery. ZTO, YTO Express, SF Express, etc. are not a problem. Just click
Just apply for a courier key on Aikuaidi (www.aikuaidi.cn). I will share the source code below. I have tested it and there is no problem. You can check express tracking information
<?php /** * 查询物流信息 */ define('IN_ECS', true); 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); // 快递公司code映射 $shipping_code = array ( 'ems' => 'ems', 'ems2' => 'ems', 'sto_express' => 'zjs', 'sto_nopay' => 'zjs', 'zto' => 'zhongtong', 'sto' => 'shentong', 'yto' => 'yuantong', 'sf' => 'shunfeng', 'emssn' => 'ems', 'sf2' => 'shunfeng', 'yunda' => 'yunda', ); $logistics_code = $shipping_code[$order_info['shipping_code']] ? $shipping_code[$order_info['shipping_code']] : $order_info['shipping_code']; $aikuaidi_key = 'xxx'; 爱快递申请 $logistics_info = file_get_contents($logistics_url); //var_dump($logistics_info); //$logistics_info = iconv('gb2312', 'UTF-8', $logistics_info); echo <<<EOF <span>收货人:<strong>{$order_info['consignee']}</strong></span> <span>联系电话:<strong>{$order_info['mobile']} // {$order_info['tel']}</strong></span> <span>配送:<strong>{$order_info['shipping_name']}</strong></span> <span>运单号:<strong>{$order_info['tracking_sn']}</strong></span><br><br> EOF; echo $logistics_info; echo "<br><br><a href='$logistics_url' target='_self'>点我点我</a>"; //exit; }

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

11 Best PHP URL Shortener Scripts (Free and Premium)

Working with Flash Session Data in Laravel

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

Build a React App With a Laravel Back End: Part 2, React

12 Best PHP Chat Scripts on CodeCanyon
