$counter = 0;
foreach($dates as $dbRow) :
$datesExp[] = [$counter => array($dbRow->e_id => new DateTime($dbRow->l_date_expect))];
++$counter;
endforeach;
使用上面的代码,我试图实现的数组格式为:
0 => array(
PK => DATE)
1 => array(
PK2 => DATE2)
....etc
但是我用 var_dump 得到的是:
array (size=3)
0 =>
array (size=1)
0 =>
array (size=1)
2 =>
object(DateTime)[7]
这是哪里来的:
array (size=1)
0=>
中间维度?