【发布时间】:2017-01-15 17:35:50
【问题描述】:
我有一个这样的网址,https://www.example.com/send?id=1&text=http://example2.com/song.mp3
当我尝试使用 file_get_contents() 获取 url 的数据时,它显示以下错误,
PHP 警告:file_get_contents(https://www.example.com/send?id=1&text=http://example2.com/song.mp3):
无法打开流:HTTP 请求失败! HTTP/1.1 501 未实现
并且 & 已转换为 &。由于该网址无效。
我在 & 上尝试过 htmlspecialchars_decode() 和 preg_replace(),但没有任何效果。
如何解决这个问题?
【问题讨论】:
-
@Xorifelse no 用 %26 转义并没有解决问题
-
引用网址是http还是https?
-
尝试使用 curl,我在下面发布并希望它能工作
-
现在工作了吗?
标签: php url htmlspecialchars