This question already has an answer here:
I have a php session $_SESSION[‘details’] and when i print_r returns the following.
Array (
[0] => Array ( [nameID] => 1357325402 [vol] => 1 [catID] => 2 )
[1] => Array ( [nameID] => 1357325423 [vol] => 1 [catID] => 2 )
[2] => Array ( [nameID] => 1357325470 [vol] => 1 [catID] => 10 )
[3] => Array ( [nameID] => 1357325440 [vol] => 1 [catID] => 4 )
[4] => Array ( [nameID] => 1357325416 [vol] => 1 [catID] => 2 )
[5] => Array ( [nameID] => 1357325471 [vol] => 1 [catID] => 10 )
)
How can a sort the array so all the the catID are together?
Array (
[0] => Array ( [nameID] => 1357325402 [vol] => 1 [catID] => 2 )
[1] => Array ( [nameID] => 1357325423 [vol] => 1 [catID] => 2 )
[2] => Array ( [nameID] => 1357325416 [vol] => 1 [catID] => 2 )
[3] => Array ( [nameID] => 1357325440 [vol] => 1 [catID] => 4 )
[4] => Array ( [nameID] => 1357325470 [vol] => 1 [catID] => 10 )
[5] => Array ( [nameID] => 1357325471 [vol] => 1 [catID] => 10 )
)
</div>