<?php
$array = array(
array(
"type" => "a",
"value" => 1
),
array(
"type" => "a",
"value" => 2
),
array(
"type" => "a",
"value" => 3
),
array(
"type" => "b",
"value" => 1
),
array(
"type" => "b",
"value" => 2
),array(
"type" => "b",
"value" => 4
),
array(
"type" => "f",
"value" => 2
)
);
foreach ($array as $element)
$newArray[$element["type"]][] = $element["value"];
var_export($newArray);
preferences:
23.51 ms | 404 KiB | 5 Q