search

Home  >  Q&A  >  body text

php利用curl发起get请求时url的参数问题

发送get请求时,url是不是不能带查询字符串,只能是域名+path呢?我的示例如下,加上查询字符串后就不好使了???

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.dest.cn/member/my.php");
//curl_setopt($ch, CURLOPT_URL, "http://www.dest.cn/member/my.php?mid=14&my_calfee=1")
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$kk = curl_exec($ch);
curl_close($ch);
print_r($kk);
天蓬老师天蓬老师2773 days ago321

reply all(1)I'll reply

  • PHPz

    PHPz2017-04-11 10:23:22

    get就是url传参

    reply
    0
  • Cancelreply