I have following array output.i want to combine them according to tax class id Please check the below array and another array format which i want is 2nd array
[0] => Array
(
[id] => 1947
[cat_id] => 48
[tax_class_id] => 18
[sku] => 620068-429-S
[qty_ordered] => 5
)
[1] => Array
(
[id] => 1947
[cat_id] => 48
[tax_class_id] => 28
[sku] => 620068-429-M
[qty_ordered] => 9
)
[2] => Array
(
[id] => 1947
[cat_id] => 48
[tax_class_id] => 18
[sku] => 620068-429-L
[qty_ordered] => 9
)
[3] => Array
(
[id] => 1947
[cat_id] => 48
[tax_class_id] => 28
[sku] => 620068-429-XL
[qty_ordered] => 9
)
I want to combine array those have same tax_class_id like below
[0] => Array(
[0] => Array
(
[id] => 1947
[cat_id] => 48
[tax_class_id] => 18
[sku] => 620068-429-S
[qty_ordered] => 5
)
[1] => Array
(
[id] => 1947
[cat_id] => 48
[tax_class_id] => 18
[sku] => 620068-429-L
[qty_ordered] => 9
)
)
[1] => Array(
[0] => Array
(
[id] => 1947
[cat_id] => 48
[tax_class_id] => 28
[sku] => 620068-429-M
[qty_ordered] => 9
)
[1] => Array
(
[id] => 1947
[cat_id] => 48
[tax_class_id] => 28
[sku] => 620068-429-XL
[qty_ordered] => 9
)
)
How can i get array in above format. where sub array has same tax_class_id.