$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, $realhost);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $regstring);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,180);
$arg1=curl_exec($ch);
if($queue_debug_mode=="1"){echo "Debug (".curl_error($ch)."): ";print_r(htmlentities($arg1));}
curl_close($ch);
print_r($arg1);输出结果为:
[RESPONSE]
code = 541
description = Command failed
reason = Nameserver requeired.请问怎么把curl_exec的结果转化为array(),我可以这样使用$response["code"]或者$response["description"]
curl_setopt($ch, CURLOPT_URL, $realhost);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $regstring);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,180);
$arg1=curl_exec($ch);
if($queue_debug_mode=="1"){echo "Debug (".curl_error($ch)."): ";print_r(htmlentities($arg1));}
curl_close($ch);
print_r($arg1);输出结果为:
[RESPONSE]
code = 541
description = Command failed
reason = Nameserver requeired.请问怎么把curl_exec的结果转化为array(),我可以这样使用$response["code"]或者$response["description"]
解决方案 »
- 如何实现windows弹出框方式的密码验证
- 高手帮忙检查下 我的分页代码的错误吧
- 看下这个功能怎么实现?叫什么功能?
- yayad是什么烂玩意?
- LAMP下怎么查看 zend optimizer 的版本
- 想请教下PHP对WSDL接口怎样传递和读取返回参数?谢谢
- 哪里有比较好的oa代码可以研究?
- 无法保存,这是怎么做到的?
- regexp问题,急!
- php下连接sql server数据库nvarchar字段的内容不能全部读出来。
- ________怎样下载php文件_______我用迅雷下载只有1kb_______只写着Access Denied_________怎办___________
- PHP 读取JAVA编写的Socket服务器端信息超时
$response=array();
$output = explode("\n",$arg1);
foreach($output as $val)
{
$tmp=@explode("=",$val);
if(count($tmp)>1)
{
$response[trim($tmp[0])]=trim($tmp[1]);
}
}
param1=value1¶m2=value2....
这样直接用parse_str就可以了