<?php
$IDs = Array
(
0 => 86456,
1 => 83981,
2 => 3444,
3 => 2296,
4 => 21515,
5 => 66707,
6 => 20507,
7 => 66985,
8 => 78067,
9 => 10364
);
$number_of_seasons = Array
(
0 => 1,
1 => 1,
2 => 1,
3 => 1,
4 => 1,
5 => 3,
6 => 3,
7 => 1,
8 => 1,
9 => 1
);
$finalArray = [];
foreach($IDs as $key=>$id){
$finalArray = array_merge($finalArray, array_fill (0, $number_of_seasons[$key], $id));
}
print_r($finalArray);
preferences:
25.12 ms | 406 KiB | 5 Q