物流问答

个人怎么获取爱快递 API key?

2023/1/20 11:39:56 来源:货代软件公司
内容摘要:key=ff4735a30a7a4e5a8637146fd0e7cec9以下为php代码$kdh = substr($keyword,2,18);$kdgs=array("zhongtong","shentong","yuantong","yunda","shunfeng","huitong","ems","tiantian","suning","zjs&

key=ff4735a30a7a4e5a8637146fd0e7cec9

以下为php代码

$kdh = substr($keyword,2,18);

$kdgs=array(“zhongtong”,”shentong”,”yuantong”,”yunda”,”shunfeng”,”huitong”,”ems”,”tiantian”,”suning”,”zjs”,”debang”,”dhl”,”kuaijie”);

$status=array(=>查询犯错,1=>暂无记载,2=>在途中,3=>派送中,4=>已签收,5=>拒收,6=>疑问件,7=>退回);//构建快递状况数组

$arrlength=count($kdgs);

for($x=0;$x<$arrlength;$x++){

$kuaidiurl=”http://www.***.cn/rest/?key=ff4735a30a7a4e5a8637146fd0e7cec9&order={$kdh}&id={$kdgs$x}&show=xml”;//快递地址

$kuaidistr=file_get_contents($kuaidiurl);//读入文件

$kuaidiobj=simplexml_load_string($kuaidistr);//xml解析

$kuaidistatus = $kuaidiobj->Status;//获取快递状况

$kuaistr=strval($kuaidistatus);//目标转换为字符串

if($kuaistr>=2){goto a;}//查找有记载则跳出循环

}

a:$contentStr0 =$status$kuaistr;//依据数组回来

foreach ($kuaidiobj->Data->Order as $a)

{xa0xa0

foreach ($a->Time as $b)

{

foreach ($a->Content as $c)

{$m.=”{$b}{$c}”;}

}

}

//遍历获取快递时刻和事情

$contentStr=”你的快递单号:{$kdh} {$contentStr0} {$m}”;xa0 xa0}xa0 xa0 xa0

以上为php代码,实测能够用的。运用作用如下,有问题能够重视大众号来沟通。

望采用!

http://www.yuntisoft.com/wuliuwenda/16756.html 个人怎么获取爱快递 API key?

免责声明:本文章部分图片素材和内容素材来源于网络,仅供学习与参考,不代表本站立场,如果损害了您的权利,请联系网站客服,我们核实后会立即删除。

标签:

快递
在线咨询
QQ咨询
微信咨询
微信咨询
电话咨询
周一至周五 9:00-18:00
135-1055-3738
回顶部