I have the following array:
Array
(
[0] => Array
(
[year] => 1
[month] => Array
(
[0] => Array
(
[month] => 2
[value] => 600
)
[1] => Array
(
[month] => 3
[value] => 600
)
[2] => Array
(
[month] => 4
[value] => 600
)
)
)
[1] => Array
(
[year] => 5
[month] => Array
(
[0] => Array
(
[month] => 6
[value] => 80
)
[1] => Array
(
[month] => 7
[value] => 90
)
[2] => Array
(
[month] => 8
[value] => 100
)
)
)
)
and also i have a foreach for 10 years that also foreach for every month. Something like this:
foreach (range(1, 10) as $year) {
foreach (range(1, 12) as $month) {
$value = $month;
}
}
Now the problem is how i can match the array with the foreach to change the $value if the $year and $month it's in the array, and if the year/month combination it's on the array the $value value needs to be the one from the that month in array.