$counter = 0;
foreach($dates as $dbRow) :
$datesExp[] = [$counter => array($dbRow->e_id => new DateTime($dbRow->l_date_expect))];
++$counter;
endforeach;
Using the above code, I'm trying to achieve is an array in format of:
0 => array(
PK => DATE)
1 => array(
PK2 => DATE2)
....etc
But what i'm getting with a var_dump is:
array (size=3)
0 =>
array (size=1)
0 =>
array (size=1)
2 =>
object(DateTime)[7]
Where is this:
array (size=1)
0=>
intermediate dimension coming from?