Home  >  Article  >  Backend Development  >  php json_decode解析json文件问题。

php json_decode解析json文件问题。

WBOY
WBOYOriginal
2016-06-23 13:32:13911browse

 怎样能将下面json的格式的value一个一个的用echo显示出来?谢谢  



输出结果:

array(3) {
  ["traffic.statistics"]=>
  array(2) {
    ["ethernet.bytes"]=>
    int(1901)
    ["low.protos"]=>
    int(2)
  }
  ["detected.protos"]=>
  array(2) {
    [0]=>
    array(4) {
      ["name"]=>
      string(6) "DHCPV6"
      ["packets"]=>
      int(1)
      ["bytes"]=>
      int(149)
      ["flows"]=>
      int(1)
    }
    [1]=>
    array(4) {
      ["name"]=>
      string(5) "LLMNR"
      ["packets"]=>
      int(4)
      ["bytes"]=>
      int(296)
      ["flows"]=>
      int(2)
    }
  }
  ["known.flows"]=>
  array(0) {
  }
}
NULL


回复讨论(解决方案)

贴出 list.json 文件内容

foreach遍历

贴出 list.json 文件内容


谢谢,我已解决

foreach遍历


谢谢
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn