PHP - converting array into sub arrays

Hi people, I’m sure theres a function or something for this but I havent found it yet. What I’ve got is a form posting the current values:

Array ( [pr_quant_1] => 6 [pr_id_1] => 3  [pr_attr_1] => 1 [pr_quant_2] => 2 [pr_id_2] => 3 [pr_attr_2] => 2 )

What I need to get from this is an array for each pr_(x)_(n) increment, so:

Array( [pr_quant] =>6 [pr_id] => 3 [pr_attr] => 1 )
Array( [pr_quant] =>2 [pr_id] => 3 [pr_attr] => 2 )

thanks!