3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ 0 => [ 'regulations_label' => 'Europe', 'groups_label' => 'G1', 'filters_label' => 'FF1' ], 1 => [ 'regulations_label' => 'Europe', 'groups_label' => 'G1', 'filters_label' => 'FF900' ], 2 => [ 'regulations_label' => 'Europe', 'groups_label' => 'G1', 'filters_label' => 'FF324234' ], 3 => [ 'regulations_label' => 'Europe', 'groups_label' => 'G2', 'filters_label' => 'FF23942' ], 4 => [ 'regulations_label' => 'America', 'groups_label' => 'G29', 'filters_label' => 'FF3242' ], 5 => [ 'regulations_label' => 'America', 'groups_label' => 'G29', 'filters_label' => 'FF78978' ], 6 => [ 'regulations_label' => 'America', 'groups_label' => 'G29', 'filters_label' => 'FF48395043' ], 7 => [ 'regulations_label' => 'Asia', 'groups_label' => 'G2000', 'filters_label' => 'FF7' ] ]; $group = []; foreach($data as $v){ $group[$v['regulations_label']][$v['groups_label']][] = $v['filters_label']; } echo '<pre>'; print_r($group);

preferences:
29.66 ms | 404 KiB | 5 Q