2015-05-06 75 views
-3

嘿傢伙我有以下示例數據,我想解析它在PHP中。你能否指導我如何在下面的數據中獲得候選對象的「板塊」和「信心」的每個值。解析php中的多個對象json

$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}]'; 

在此先感謝

+3

你嘗試過什麼嗎? –

+0

'json_decode()'將解析JSON並根據需要生成數組或對象。從那裏拿走。 –

+0

[PHP-解碼JSON]的可能重複(http://stackoverflow.com/questions/19609354/php-decode-json) –

回答

1

這是非常簡單的,儘量使用json_decode($sample_data);結果是PHP數組。