try this
$data = array();
foreach($d as $key => $value) {
if(key_exists($value["name"], $data)) {
$d = $data[$value["name"]];
$d["serial"] .= $value["serial"] . ", ";
$data[$value["name"]] = $d;
}
else {
$data[$value["name"]] = array( "name" => $value["name"], "serial" => $value["serial"]. ", ", "unit_price" => $value["unit_price"] );
}
}
echo "<pre>";
print_r($data);
echo "</pre>";
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…