$AttrData =array(
array(
[id] => 【3】,
[kun] => 10,
[gongsi_id] => 1,
[title] => 冰糖,
[jine] => 2.00,
[big] => 2,
),
array(
[id] => 【2】,
[kun] => 10,
[gongsi_id] => 1,
[title] => 加糖,
[jine] => 1.00,
[big] => 2,
),
array(
[id] => 【4】,
[kun] => 10,
[gongsi_id] => 1,
[title] => 高温,
[jine] => 1.00,
[big] => 1,
),
array(
[id] => 【1】,
[kun] => 10,
[gongsi_id] => 1,
[title] => 常温,
[jine] => 0.00,
[big] => 1,
)
);
$AttrData_xin = array();
//循环原先一维数组,相同键值的进行存储
foreach ($AttrData as $key => $rs) {
$AttrData_xin[$rs['big']][] = $rs;
}
print_r($AttrData_xin );
仅提供参考