dpl74687 2015-11-13 18:54
浏览 35
已采纳

JSON Decode返回NULL

I make a curl request to a URL, got this JSON $data back

{"status":200,"message":"Success","data":[{"cpe_mac":"665544332211","device_mac":"223344556677","device_activity":"INACTIVE","dhcp_lease_held":"CONNECTED_DEVICE_DHCP_LEASE_NOT_AVAILABLE","ip_address":"127.0.0.3","vlan_id":1002,"hostname":"babyhost","dhcp_lease_start_time":400,"dhcp_lease_length":600,"interface":"WIRELESS","ssid":"2219","port_ranges":[{"startport":0,"endport":06000:6500}],"last_updated_utc_in_secs":1446061806668}]}

Then, I decode that $raw = json_decode($data, true);

When I print them out I got null

dd($raw); // null


I just want to convert that json to an array and access it.

Any hints on this will be much appreciated !

  • 写回答

2条回答 默认 最新

  • donglie7778 2015-11-13 18:59
    关注

    The json that is returned is invalid

    enter image description here

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题