我有两个关联数组。 $dpt_total
是部门列表,以及这些部门的总数。$cl_subtotal
是部门、类和小计的多维数组。
我想显示部门和总计,然后是与该部门关联的类和该类的小计。例如:
vdump($dpt_total);
array(2) {
'None' → float 132.88
'instore bakery' → float 786.24
}
Sizes: 2
vdump($cl_subtotal);
array(2) {
'None' → array(1) {
'None' → float 132.88
}
'instore bakery' → array(10) {
'pies' → float 70.94
'cakes' → float 146.71
'miscellaneous' → float 25.57
'cookies' → float 52.38
'brownies' → float 33.96
'rolls' → float 143.02
'danish' → float 90.42
'bagels & pretzels' → float 85.68
'breads' → float 55.73
'dessert case' → float 81.83
}
}
应该显示这些:
Department Class Total
--------------------------------
None 132.88
None 132.88
Instore Bakery 786.24
pies 70.94
cakes 146.71
misc 25.57
cookies 52.38
(and so on)