【发布时间】:2017-08-07 15:42:57
【问题描述】:
在 file_get_content 上出现错误,它将 & 替换为 &,因此我收到 d 错误。我得到的数据是 json 格式的。
原始网址为:xyz.abc.com/index.php/DeviceDetails/GetDeviceHistory?tracking_id=70&start_time=2017-03-05 13:14:50&end_time=2017-03-08 13:14:50
<b>Warning</b>: file_get_contents(http://xyz.abc.com/index.php/DeviceDetails/GetDeviceHistory?tracking_id=70&start_time=2017-03-05 13:14:50&end_time=2017-03-08 13:14:50): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
in
<b>/home/abc/public_html/php/service.php</b> on line
<b>1855</b>
<br />
{"Status":"false","message":"No data found"}
请帮我解决这个错误
【问题讨论】:
-
你能提供更多关于你的项目或代码的信息吗?
-
它只是将错误消息中的
&amp;替换为&amp;。这个问题中没有足够的信息给我们提供任何帮助 -
未找到数据尝试其他日期范围
-
@RiggsFolly 这是我的代码 $tracking_id = $_REQUEST['sharedid']; $start_time = $_REQUEST['start_time']; $end_time = $_REQUEST['end_time']; $url = "xyz.abc.com/index.php/DeviceDetails/…"; $result = file_get_contents($url); $restvm = json_decode($result,true);
-
@RiggsFolly 我用 & 得到了结果,但是 file_get_contents 正在将 & 变成 &
标签: php json warnings file-get-contents