I have an associative array which store a record of an event table, lets call it $A
and I have $events which contains many records of $A (so $events is a 2 dimension array)
Now I need to examine the $events and copy some of it to another variable called $theEvents
I'm using array_merge but the result is not as I expected.
It seems like everything is combined into a 1-dimension array.
My coding is something like this:
if($events = haveEvent($Day_Counter,$Month,$Year)
{
$theEvents = array();
foreach ($events as $eve)
{
if($eve[personal]=="N" || $eve[eclub]==$session[id])
$theEvents = array_merge($theEvents, $eve);
}
foreach ($theEvents as $event)
print $event[ename];
}
The result was I got an event with 30 fields which actually I should have 3 events with 10 fields each.
Any suggestion?
Thank you in advance