PHP cURL 获取带有重音 URL 的内容
使用带重音 URL 的 cURL,如果 CURLOPT_RETURNTRANSFER = true,我无法获取内容。
示例:
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, "http://fr.wikipedia.org/wiki/Été");
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, true);
$html = curl_exec ($curl);
echo $html;
$html 为空,有人有解决方案吗?
Using cURL with an accented URL, I cannot get content if CURLOPT_RETURNTRANSFER = true.
Example:
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, "http://fr.wikipedia.org/wiki/Été");
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, true);
$html = curl_exec ($curl);
echo $html;
$html is empty, does someone have a solution ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用 urlencode 作为 url 的重音部分:
看看会发生什么。
Try using urlencode for the accent part of the url:
And see what happens.