如何从Instagram __A = 1页读取JSON文件

发布于 2025-02-03 03:36:31 字数 265 浏览 2 评论 0原文

我正在尝试调用URL并使用PHP阅读其内容。 当我将URL直接放在浏览器中时,它可以工作,但是当我使用PHP时,它会返回空字符串。 这是我的代码:

$url = "https://www.instagram.com/instagram/?__a=1"
$json = file_get_contents($url);
$res= json_decode($json);
var_dump($res);

有人知道为什么我无法阅读PHP的文件吗? 谢谢你,

I’m trying to call a URL and read its content using php.
when I place the url directly in the browser It works, but when I use php it returns empty string.
here’s my code:

$url = "https://www.instagram.com/instagram/?__a=1"
$json = file_get_contents($url);
$res= json_decode($json);
var_dump($res);

Does anyone have an idea why I can’t read the file with PHP?
Thank you,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文