3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['parent 1', '10000', '20000'], ['parent 1', '15000', '21000'], ['parent 2', '13000', '22000'], ['parent 2', '11000', '5000'], ]; $output = []; foreach ($array as $key => $value) { $output[$value[0]][] = array($value[1],$value[2]); } print_r($output); ?>

preferences:
23.43 ms | 404 KiB | 5 Q