array:3 [▼ 0 => array:2 [▼ "examCourseId" => "1039" "total" => 2.3 ] 1 => array:2 [▼ "examCourseId" => "1039" "total" => -3.0 ] 2 => array:2 [▼ "examCourseId" => "10007" "total" => 15.5 ] ]
For examCourseId = 1039 it need to be [2.3, -3.0] For examCourseId = 10007 it need to be [15.5] Total Array should be [ [2.3, -3.0], [15.5] ]
$group = array(); foreach (array as $value) { $group[$value['examCourseId']][] = $value; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)