【发布时间】: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