I have an array with different arrays in them with values. I want to loop over these arrays inside to get all the values but for some reason It only goes over the first array.
Here's what the array looks like: This array's name is slots.
Array
(
[41] => Array
(
[0] => Array
(
[attractie] => attractie1
[start] => 0930
[end] => 1200
[personen] =>
[catering] => 1
[bedrijfsnaam] => attractie1
[link] => http:
[color] => dd0330
)
[1] => Array
(
[attractie] => attractie1
[start] => 1000
[end] => 1230
[personen] =>
[catering] => 1
[bedrijfsnaam] => Bedrijf2
[link] => http:
[color] => e49fca
)
)
[52] => Array
(
[0] => Array
(
[attractie] => attractie2
[start] => 0930
[end] => 1030
[personen] =>
[catering] => 1
[bedrijfsnaam] => Bedrijf4
[link] => http:
[color] => f7e300
)
[1] => Array
(
[attractie] => attractie2
[start] => 0930
[end] => 1030
[personen] =>
[catering] => 0
[bedrijfsnaam] => bedrijf5
[link] => http:
[color] => f78f1e
)
)
)
So this is what my loop looks like:
$i=0;
foreach($slots[$attractieIDs[$i]] as $s){
$myOrders[] = array( 'attractie' => $s['attractie'],
'name' => $s['bedrijfsnaam'],
'start' => $s['start'],
'end' => $s['end'],
'link' => $s['link'],
'personen' => $s['personen'],
'catering' => $s['catering'],
'color' => $s['color'],
);
$i++;
}
attractieID is an array with the id's in them the (41 and 52).
When I print out $myOrders I only get to see the values of the array with id 41 it doesn't go to the next array with a new id.
Anyone knows how I can fix this?
Many thanks in advance!