您好,欢迎访问一九零五行业门户网

PHP curl 使用代码

$ch=curl_init();
curl_setopt($ch,curlopt_url,“http://dwz.cn/create.php”);
curl_setopt($ch,curlopt_post,true);
curl_setopt($ch,curlopt_returntransfer,true);
$data=array('url'=>'http://www.baidu.com/');
curl_setopt($ch,curlopt_postfields,$data);
$strres=curl_exec($ch);
curl_close($ch);
$arrresponse=json_decode($strres,true);
var_dump($arrresponse);
if($arrresponse['status']!=0)
{
/*错误处理/
echo iconv('utf-8','gbk',$arrresponse['err_msg']).“ok\n”;
}
/* tinyurl /
echo$arrresponse['tinyurl'].“\n”;
留着吧,
其它类似信息

推荐信息