代码如下,但是没有获取到搜索这个$name关键词应有的数据,求解?
$name="进击的巨人";
$url="http://www.4567.tv/search.asp";
$data = array (
'typeid'=>'2',
'keyword' => urlencode(mb_convert_encoding($name, "GBK","UTF-8")),
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$c=curl_exec($ch);
curl_close($ch);
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
urlencode 去掉
这是接口的请求例子吧?
应该没有什么问题,你把根证书验证关了试一下