PHP头条
热点:

phpcurl提交参数中文乱码问题


phpcurl乱码

A站通过url形式POST数据注册B站,psot的中文,在B站是显示乱码的;
直接贴码:
$name="黄飞鸿";
$password="123456";
$get_url = "http://www.xxx.com/reg.php?name=".$name."&password=".$password
$row=getToken($get_url);

$obj=json_decode($row);

function getToken($url){
$ch = curl_init();
$this_header = array("content-type: application/x-www-form-urlencoded; charset=UTF-8");
curl_setopt($ch, CURLOPT_HTTPHEADER,$this_header);
curl_setopt($ch, CURLOPT_URL,$url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
return curl_exec($ch);
}

对方收到的name是乱码的;导致注册失败。
求大侠支招~

www.phpzy.comtrue/php/2497.htmlTechArticlephpcurl提交参数中文乱码问题 phpcurl乱码 A站通过url形式POST数据注册B站,psot的中文,在B站是显示乱码的; 直接贴码: $name="黄飞鸿"; $password="123456"; $get_url = "http://www.xxx.com/reg.php?name="....

相关文章

相关频道:

PHP之友评论

今天推荐