How to restructure an array of single-element associative arrays into grouped subarrays?
问题 I have an associative array: Array ( [0] => Array ( [term_title] => black ) [1] => Array ( [color_quantity] => 2 ) [2] => Array ( [color_price] => 22 ) [3] => Array ( [term_title] => blue ) [4] => Array ( [color_quantity] => 3 ) [5] => Array ( [color_price] => 33 )) How can I change it into: Array ( [0] => Array ( [term_title] => black, [color_quantity] => 2, [color_price] => 22 ) [1] => Array ( [term_title] => blue, [color_quantity] => 3, [color_price] => 33 ) ) I try the following code: