$arr=array(
'Teaching Department'=>array(
array('Li','18','Lady'),
array('Gao','20','Male'),
array('Zhang','21','Yaoren'),
),
'Propaganda Department'=>array(
array('Li','18','Lady'),
array('Gao','20' ,'Male'),
array('Zhang','21','Yaoren'),
),
'Finance Department'=>array (
array('Li','18','Lady'),
array('Gao','20','Male'),
array('Zhang','21','Yaoren'),
),
);
##
foreach ($arr as $key => $value) {
foreach ($value as $val) {
echo "Department:" .$key." Name: ".$val[0]." Age: ".$val[1]." Gender: ".$val[2]."
";
}
}
You can’t use key values like that
This array syntax is no longer used, please use: [...]