sort multidimensional arrays by name.
specify the index and order to sort your multiarray.

sort multidimensional arrays by name. specify the index and order to sort your multiarray.

array sorted by fieldname "first" in descending order

Array ( [first] => 56 [second] => maria )
Array ( [first] => 36 [second] => simone )
Array ( [first] => 25 [second] => fred )
Array ( [first] => 12 [second] => tom )
Array ( [first] => 3 [second] => peter )

array sorted by fieldname "second" in ascending order

Array ( [first] => 25 [second] => fred )
Array ( [first] => 56 [second] => maria )
Array ( [first] => 3 [second] => peter )
Array ( [first] => 36 [second] => simone )
Array ( [first] => 12 [second] => tom )