Group multidimensional array data based on two column values and sum values of one column in each group [duplicate]
I have an array which is created as a combination of two database queries from two separate databases, it looks similar to:
$arr1 = ;
I am looking for a way to group this array by part and type values. I also need to know the total of the count values as they are grouped.
The results would be something like:
$arr2 = ;
but I just can't see how to do this. I have seen a few examples of grouping by a single key/value, but not by multiple values at once.
0 answers
Hot tools Tags
Hot Questions
Popular tool
vc9-vc14 (32+64 bit) runtime library collection (link below)
Download the collection of runtime libraries required for phpStudy installation
VC9 32-bit
VC9 32-bit phpstudy integrated installation environment runtime library
PHP programmer toolbox full version
Programmer Toolbox v1.0 PHP Integrated Environment
VC11 32-bit
VC11 32-bit phpstudy integrated installation environment runtime library
SublimeText3 Chinese version
Chinese version, very easy to use
Hot Topics
20414
7
13573
4






