我正在使用CURL来获取Yahoo! 带有unicode查询的BOSS api url,但是我收到了"错误请求"错误.
http://boss.yahooapis.com/ysearch/web/v1/??????????appid={appid}&format=xml
Run Code Online (Sandbox Code Playgroud)
上面的url工作正常,并在firefox中返回结果.
请任何人帮我解决这个问题.
$url = "http://boss.yahooapis.com/ysearch/web/v1/??????????appid={appid}&format=xml";
$ch - curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
Run Code Online (Sandbox Code Playgroud)
小智 -8
采取 \xe0\xae\x95\xe0\xae\xae\xe0\xae\xb2\xe0\xaf\x8d\xe0\xae\xb9\xe0\xae\xbe\xe0\xae\x9a\xe0\xae\xa9 \xe0\xaf\x8d 字并在 PHP 中使用 \nMysql_realescape 字符串。
\n\n此致,\n架构师。
\n