Blogger Information
Blog 17
fans 0
comment 0
visits 23401
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
TP5调用快递网API查询快递
星辰幽梦
Original
1038 people have browsed it

TP5调用快递网API查询快递

首先要在快递网申请到一个API,免费版的一天可以查500次,注意:顺丰不能查!顺丰不能查!顺丰不能查!
申请成功的话,快递网会发一个邮件给你,里面有一个专属id,接口中需要返回,另外还有返回
快递公司编号和订单号,我采用的是CURL来获取

  1. $url = "http://api.kuaidi.com/openapi.html?id=申请到的key&com=".快递公司编号."&nu=".订单号;
  2. $ch = curl_init();
  3. curl_setopt($ch, CURLOPT_URL, $url);
  4. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  5. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  6. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  7. $info_list = curl_exec($ch);
  8. curl_close($ch);
  9. $info_list = json_decode($info_list,true);
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post