В дополнение к этому Вопросу группа данных Json по значению, используя php
теперь я хочу сгруппировать прибор по номеру пула Json Data здесь
{ "items":[ {"id":129481,"draw_id":27718,"number":1,"pool":-1, "fixtures":[ {"id":"529348","name":"TBC vs TBC","round":{"id":129481,"number":1,"round_info":"PRE QUARTER FINALS","published":true},"match_result":null,"matches":[],"officials":[],"_score":null,"_type":"fixture"}, {"id":"529349","name":"TBC vs TBC","round":{"id":129481,"number":1,"round_info":"PRE QUARTER FINALS","published":true},"match_result":null,"matches":[],"officials":[],"_score":null,"_type":"fixture"}, {"id":"529352","name":"TBC vs TBC","round":{"id":129481,"number":1,"round_info":"PRE QUARTER FINALS","published":true},"match_result":null,"matches":[],"officials":[],"_score":null,"_type":"fixture"} ], "byes":[] }, {"id":129493,"draw_id":27718,"number":1,"pool":1, "fixtures":[ {"id":"529390","name":"Service Organization vs Friends Association","round":{"id":129493,"number":1,"round_info":"League","published":true},"match_result":null,"matches":[],"officials":[],"_score":null,"_type":"fixture"}, {"id":"529391","name":"Service Organization vs Shaheen Makhdoom","round":{"id":129493,"number":1,"round_info":"League","published":true},"match_result":null,"matches":[],"officials":[],"_score":null,"_type":"fixture"} ], "byes":[] }, {"id":129492,"draw_id":27718,"number":1,"pool":2, "fixtures":[ {"id":"529387","name":"Prince Manki vs ECB","round":{"id":129492,"number":1,"round_info":"League","published":true},"match_result":null,"matches":[],"officials":[],"_score":null,"_type":"fixture"}, {"id":"529388","name":"Prince Manki vs Moon Star Sports Center","round":{"id":129492,"number":1,"round_info":"League","published":true},"match_result":null,"matches":[],"officials":[],"_score":null,"_type":"fixture"} ], "byes":[] }, {"id":129482,"draw_id":27718,"number":2,"pool":-1, "fixtures":[ {"id":"529356","name":"TBC vs TBC","round":{"id":129482,"number":2,"round_info":"Quarter Finals","published":true},"match_result":null,"matches":[],"officials":[],"_score":null,"_type":"fixture"}, {"id":"529357","name":"TBC vs TBC","round":{"id":129482,"number":2,"round_info":"Quarter Finals","published":true},"match_result":null,"matches":[],"officials":[],"_score":null,"_type":"fixture"} ], "byes":[]}, {"id":129483,"draw_id":27718,"number":3,"pool":-1, "fixtures":[ {"id":"529360","name":"TBC vs TBC","round":{"id":129483,"number":3,"round_info":null,"published_at":"2016-11-10T20:32:50+13:00","published":true},"match_result":null,"matches":[],"officials":[],"_score":null,"_type":"fixture","_index":"fixtures","_version":null,"sort":[1481054400000,529360],"highlight":null,"_explanation":null}, {"id":"529359","name":"TBC vs TBC","round":{"id":129483,"number":3,"round_info":null,"published_at":"2016-11-10T20:32:50+13:00","published":true},"match_result":null,"matches":[],"officials":[],"_score":null,"_type":"fixture","_index":"fixtures","_version":null,"sort":[1481077800000,529359],"highlight":null,"_explanation":null} ], "byes":[] } ], "meta":{"total_pages":1}
}
$json = json_decode($json, true); $groupedItems = []; $items = $json['items']; foreach ($items as $item) { $pool = $item['pool']; $groupedItems[$pool][] = $item; } ksort($groupedItems); var_dump($groupedItems);