3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "Error": "", "ErrorCode": 0, "Guid": "", "Id": 0, "Success": true, "Value": [ { "MAIN": 225, "PHASE": 219418523, "G": "7TH Division", "GI": "2031892", "DOOR": "8907", "Gate": { "RG": 2, "BNS": "4 Window", "BS": { "SB1": 2 }, "TQ": [ { "Key": 1, "Value": { "T1": 2 } }, { "Key": 2, "Value": {} } ], "MR": -1, "MS": 600 }, "AA": "81", "AI": "8745524" }, { "MAIN": 300, "PHASE": 219418523, "G": "8TH Division", "GI": "4526892", "DOOR": "8877", "GATE": { "RG": 2, "BNS": "5 Window", "BS": { "SB1": 2 }, "TQ": [ { "Key": 1, "Value": { "T1": 2 } }, { "Key": 2, "Value": {} } ], "MR": -1, "MS": 600 }, "AA": "91", "AI": "8758421" }]}'; $parsed = json_decode($json,true); $result = []; if($parsed['Success']){ // check if your api json response is true. foreach($parsed['Value'] as $val){ $result[] = [ "G"=> $val['G'], "GI"=> $val['GI'], "DOOR"=> $val['DOOR'], "AA"=> $val['AA'], "AI"=> $val['AI'] ]; // or what you want. } } echo json_encode($result);
Output for git.master, git.master_jit, rfc.property-hooks
[{"G":"7TH Division","GI":"2031892","DOOR":"8907","AA":"81","AI":"8745524"},{"G":"8TH Division","GI":"4526892","DOOR":"8877","AA":"91","AI":"8758421"}]

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
113.01 ms | 405 KiB | 5 Q