php 使用 file_get_contents 检索数据

php retriving data using file_get_contents

我正在尝试使用 file_get_contents() 从以下 link 检索 JSON 响应,但我似乎无法获得响应。但是,当我在浏览器中键入 link 时,我得到了响应。

如何阅读 PHP 中的回复?我已经尝试使用

<?php
echo file_get_contents("http://demo.openalpr.com:8010/status?nonce=772493352");
?> 

没有成功。

很可能您没有激活 allow_url_fopen 设置,因此您的 PHP 脚本无法加载远程 URL。

检查您的 php.ini 文件并将其设置为 On