//curl post函数functioncurlMethod($str,$data){$data=urlencode(base64_encode(json_encode($data)));$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$str);//设置链接curl_setopt($ch,CURLOPT_POST,1);//设置为POST方式curl_setopt($ch,CURLOPT_POSTFIELDS,array('data'=>$data));//POST数据curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);//设置是否返回信息$server_output=curl_exec($ch);//接收返回信息curl_close($ch);//关闭curl链接$arr=json_decode($server_output,true);return$arr;}© admin for可乐吧, 2015. |Permalink|No comment|
Add
...
继续阅读
(29)