They are simplified as follows which is enough for this question. This question is based on this answer.
[a][b][]
and
foreach($array1 as $a => $c) { $end_array[$c] = $array2[$a]; }
or
// For every [a] foreach($array1 as $a => $c) { // Get the [b] $b = $array2[$a]; // Add it to [a][c] $end_array[$a][$c] = $b; // Making it $end_array[$a][$c][$b] = array(....); }