我有一个名为的数组$mydata
,如下所示:
Array
(
[0] => Array
(
[id] => 1282
[type] =>2
)
[1] => Array
(
[id] => 1281
[type] =>1
)
[2] => Array
(
[id] => 1266
[type] =>2
)
[3] => Array
(
[id] => 1265
[type] =>3
)
)
我已将数组分配给 smarty$smarty->assign("results", $mydata)
现在,在模板中,我需要打印数组中每种“类型”的数量。谁能帮我做到这一点?