我正在尝试在循环中构建一个多维数组,我很困惑为什么这段代码不起作用
<?php
$users = array(35,25,45,34,56,67);
$months = array('smelly','stinky','chubby','grubby','nubby','funky');
foreach($users as $user){
$mdata[$user] = array();
foreach($months as $month){
array_push($mdata[$user][],$month);
}
}
print_r($mdata);
?>