So I have a multidimensional array in the form (actual array can be much longer 500+ members)
$marr = array(
array("s_id" => 1, 1.25 , 15),
array("s_id" => 2, 0.75 , 25),
array("s_id" => 1, 1.15 , 7)
);
I am trying to break it into an array grouped/indexed by the s_id value of the member arrays
$sarr = array(
1 => array(
array("s_id" => 1, 1.25 , 15),
array("s_id" => 1, 1.15 , 7)
),
2 => array(
array("s_id" => 2, 0.75 , 25)
)
);
Is there a built in function in php to do this or some best practice way of doing this?