PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

php快递单号查询源码_PHP教程

原创
2016-07-13 10:29:35 998浏览

贴下记录下php查询快递单号的源码,能查询各种快递的快递单号记录,中通、圆通快递、顺丰快递等都不是问题。只需要在

爱快递(www.aikuaidi.cn)上面申请一个快递key即可,下面把源码分享下,本人测试过,没有问题的。可以查询到快递跟踪信息

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 <<收货人:{$order_info['consignee']}
        联系电话:{$order_info['mobile']} // {$order_info['tel']}
        配送:{$order_info['shipping_name']}
        运单号:{$order_info['tracking_sn']}

EOF; echo $logistics_info; echo "

点我点我"; //exit; }

  

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/770660.htmlTechArticle贴下记录下php查询快递单号的源码,能查询各种快递的快递单号记录,中通、圆通快递、顺丰快递等都不是问题。只需要在 爱快递(www.a...
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。