【问题标题】:parsing multi object json in php [closed]在 php 中解析多对象 json [关闭]
【发布时间】:2015-07-16 07:55:06
【问题描述】:

大家好,我有以下示例数据,我想用 php.ini 解析它。能否请您指导我如何在下面的数据中获取候选对象中“plate”和“confidence”的每个值。

$sample_data = [{"job_status": 3, "plates": {"data_type": "alpr_results", "epoch_time": 1430894595648, "img_height": 723, "img_width": 1280, "results": [{"plate": "RAC162R", "confidence": 90.876228, "region_confidence": 0, "region": "", "plate_index": 0, "processing_time_ms": 38.729237, "candidates": [{"matches_template": 0, "plate": "RAC162R", "confidence": 90.876228}], "img_height": 723, "img_width": 1280}]';

提前致谢

【问题讨论】:

  • 你有没有尝试过?
  • json_decode() 将解析 JSON 并根据需要生成数组或对象。从那里拿走。
  • PHP- Decode JSON的可能重复

标签: php arrays json object nested


【解决方案1】:

很简单,尝试使用json_decode($sample_data);结果是php数组。

【讨论】:

    猜你喜欢
    • 2013-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-18
    • 2012-08-12
    • 2014-09-24
    • 2013-04-29
    相关资源
    最近更新 更多