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

download options for array handling / complex array sort

you can download the source as PHP file,

open the file as plain text in a new window or

get the code in a textarea to copy it.