2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > php快递单号查询接口使用示例

php快递单号查询接口使用示例

时间:2023-07-20 23:36:09

相关推荐

php快递单号查询接口使用示例

php教程|php手册

快递单号查询

php教程-php手册

android项目源码分析,ubuntu安装sbcl,tomcat服务会冲突吗,爬虫歌单歌词,员工管理系统源代码php,荆州便宜的seo推广怎么做lzw

这篇文章主要介绍了php快递单号查询接口使用示例,需要的朋友可以参考下

不存在页面源码,vscode提交git仓库,ubuntu ,tomcat7 run,sqlite3代码学习,如何制作网页设计,navicat新建数据库,iphone 收件服务器设置,头像编辑插件,前端框架电子期刊怎么样,爬虫看图,php跳出循环,淄博网站seo,springboot源码书,文章列表标签,开源代码网站,微信对话生成 网页版,thinkphp 修改模板路径,易营销站后台,go post跳转页面,企业后台管理系统论文,dj程序lzw

1 1 棋牌 源码下载,ubuntu 调整字体,tomcat应用字符集,python爬虫学习攻略,php安全技术和实术学习,seo红鱼培训lzw

通过本接口可以查询圆通快递、申通快递、ems快递、韵达快递等快递单号查询信息,无需其他额外开发,,非常方便

首先到上注册个账号,使用key!

复制代码 代码如下:

<?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 = ‘xxxxxxx’;

$logistics_url = “/rest/?key=$aikuaidi_key&order={$order_info[‘tracking_sn’]}&id=$logistics_code&ord=asc&show=html”;

$logistics_info = file_get_contents($logistics_url);

//var_dump($logistics_info);

//$logistics_info = iconv(‘gb2312’, ‘UTF-8’, $logistics_info);

echo <<<EOF

收货人:{$order_info[‘consignee’]}

联系电话:{$order_info[‘mobile’]} // {$order_info[‘tel’]}

配送:{$order_info[‘shipping_name’]}

运单号:{$order_info[‘tracking_sn’]}

EOF;

echo $logistics_info;

echo “

点我点我”;

//exit;

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。