我正在尝试对此 Demo URL 执行 file_get_contents
但是服务器无法从外部站点获取数据。这是我回显 file_get_contents 时得到的错误:
Found The document has moved here. Apache/2.4 Server at spotifycharts.com Port 80
我已经在 php.ini 文件
中打开了 register_global
,但这没有帮助。
为了确保我的网站能够从外部网站获取数据,最合乎逻辑的检查是什么?
最佳答案
只需使用 https url 而不是 http url:
https://spotifycharts.com/api/?type=regional&country=nl&recurrence=daily&date=latest&limit=200
关于php - 对外部站点的 file_get_contents 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34397107/