I have the below array:
Array
(
[Support Services - 1] => Array
(
[0] => Array
(
[team] => Delivery Excellence
[count] => 4
[location] => Location1
)
[1] => Array
(
[team] => Delivery Excellence
[count] => 1
[location] => Location2
)
)
)
I want the array to be rearranged in the following pattern for Excel download
I have the header array as follow:
$finalArrayHeader = array('Department');
foreach($location_data as $key=>$value){
array_push($finalArrayHeader,$value['name']);
}
array_push($finalArrayHeader,'Grand Total');
As the locations are dynamic
Thanks for helping.