我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

无法将json数组解码为php数组

I am having troubles with decoding json array. I have an external url in json format: http://genie.kz/api.json

And i am trying to get with function file_fet_contents then decode it.

Here is the code:

$data = json_decode( file_get_contents( 'http://genie.kz/api.json' ), true );

foreach($data as $item) {
    echo $item['code'];
}

However, i could not get any values and var_dump() retrives NULL.

Thanks in advance.

近期文章

  • PHP 7.1 void返回类型的理解
  • 查询Google Search Console API PHP
  • 在bootstrap模式中传递不同的变量
  • 不需要在php代码中将mysql中的0添加到int数据类型中
  • 使用php从html页面中的特定行提取数据
  • 如何通过PHP或JavaScript读取外部iframe
  • Laravel 5 - 在中间件中调用$ request-> path()导致Laravel忽略对请求URI的更改?
  • ajax serialize给出不同的字符串,表单自动保存不起作用
  • wp_get_attachment_image没有工作wordpress来显示博客帖子图片
  • 在使用javascript选择选项上获取多个文本框时出现问题
  • 在linux服务器上设置未知属性:yii \ console \ ErrorHandler :: errorAction
  • 控制窗口大小[重复]
  • PHP Regex从url标记获取名称
  • PHP - 从json保存对象密钥
  • 使用Javascript添加/删除表行
  • 使用谷歌折线图的多线
  • Ajax接口的服务器端语言? [关闭]
  • PHP:创建一些表单并使用<a href提交
  • 收到新邮件后通知php cli脚本
  • 从MAMP切换到MAMP Pro,无法启动mysql

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华