array (size=80)
0 =>
array (size=5)
0 => string '305' (length=3)
1 => string '308' (length=3)
2 => string '508' (length=3)
3 => string '509' (length=3)
4 => '510' array ()
0 => string 'Ширина' (length=3)
1 => string 'Высота' (length=3)
2 => string 'мм' (length=3)
1 =>
array (size=5)
0 => string '305' (length=3)
1 => string '308' (length=3)
2 => string '508' (length=3)
3 => string '515' (length=3)
4 => string '516' (length=3)
2 =>
array (size=5)
0 => string '305' (length=3)
1 => string '308' (length=3)
2 => string '541' (length=3)
3 => string '542' (length=3)
4 => string '543' (length=3)
3 =>
array (size=5)
0 => string '305' (length=3)
1 => string '308' (length=3)
2 => string '541' (length=3)
3 => string '548' (length=3)
4 => string '549' (length=3)
4 =>
array (size=5)
0 => string '305' (length=3)
1 => string '308' (length=3)
2 => string '554' (length=3)
3 => string '555' (length=3)
4 => string '556' (length=3)
5 =>
array (size=5)
0 => string '305' (length=3)
1 => string '308' (length=3)
2 => string '554' (length=3)
3 => string '561' (length=3)
4 => string '562' (length=3)
$new_arr = array();
$arr = array(
'0' =>
array (
0 => '305',
1 => '308',
2 => '508',
3 => '509',
4 => '510',
),
'1' =>
array (
0 => '305',
1 => '308',
2 => '508',
3 => '515',
4 => '516',
),
'2' =>
array (
0 => '305',
1 => '308',
2 => '541',
3 => '542',
4 => '543',
),
'3' =>
array (
0 => '305',
1 => '308',
2 => '541',
3 => '548',
4 => '549',
),
'4' =>
array (
0 => '305',
1 => '308',
2 => '554',
3 => '555',
4 => '556',
),
'5' =>
array (
0 => '305',
1 => '308',
2 => '554',
3 => '561',
4 => '562',
),
);
foreach($arr as $key => $item){
$item = array_reverse($item);
foreach($item as $key2 => $sub){
$new_arr[$key]['val']= $sub;
$new_arr[$key] = ['0' => $new_arr[$key]];
}
}