php group subarrays by column key

30

$group = array();

foreach ( $array as $value ) {
    $group[$value['id']][] = $value;
}

var_dump($group);

Comments

Submit
0 Comments