我有这个多数组“$marray 里面有一些类似 key = value 的数组,有些看起来不像这样:
$marray = array(
array("id" => "1", "be_pro" => 6, "name" => "a1", "service" => 4a),
array("id" => "2", "be_pro" => 6, "name" => "a1", "service" => 4d),
array("id" => "3", "be_pro" => 4, "name" => "a4", "service" => 3d),
array("id" => "4", "be_pro" => 4, "name" => "a4", "service" => 3s),
array("id" => "6", "be_pro" => 4, "name" => "a4", "service" => 34),
array("id" => "8", "be_pro" => 3, "name" => "a3", "service" => 4r),
array("id" => "8", "be_pro" => 3, "name" => "a3", "service" => 4d)
);
所以我想获得带有“id”、“be_pro”和“name”的新数组,然后从下一个数组中获取“service”加上“service”,直到新数组中的“be_pro”不同,所以如果不同的话放在下一个数组。
我该怎么做?
我需要的是打印一个多数组和数组,每一行都有类似的be_pro