public function showLogistics(){
$type=$_POST[‘type‘]=‘shentong‘;
$postid=$_POST[‘postid‘]=‘3311725299939‘;
//$url = "http://m.kuaidi100.com/index_all.html?type=".$goods_orderarr["express_con"]."&postid=".$goods_orderarr["out_order_num"];
$url = "http://m.kuaidi100.com/query?type={$type}&postid={$postid}&id=1";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_HEADER, 0); //设置Header
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//测试时输出到页面 0
$js curl_exec($ch);
curl_close($ch);
$re = json_decode($json,true);
$rs = array(
"list"=>$re
);
if($re["status"]=="200"){
$re = array("status"=>1,"code"=>200,"msg"=>"确认成功!","data"=>$rs);
$this->ajaxReturn($re);
}else{
$re = array("status"=>0,"code"=>102,"msg"=>"数据异常,请稍后再试!");
$this->ajaxReturn($re);
}
}
curl_multi_*批处理超时:
while ($mrc == CURLM_CALL_MULTI_PERFORM);改成$active>0
正则匹配汉字:^[\x{4e00}-\x{9fa5}]+$
正则匹配双字节文字(包括汉字):^[^\x00-\xff]+$