I can find a ton of writeups on how to ordering a indexed array ($aData[1]=...)and a ton of writeups on ordering a keyed array ($aData['first']=...).
I am, however having no luck finding a writeup on ordering a indexed array of keyed arrays:
$data[] = array('volume' => 67, 'edition' => 2);
$data[] = array('volume' => 86, 'edition' => 1);
$data[] = array('volume' => 85, 'edition' => 6);
$data[] = array('volume' => 98, 'edition' => 2);
$data[] = array('volume' => 86, 'edition' => 6);
$data[] = array('volume' => 67, 'edition' => 7);
The above is from PHP.NET. However, in their sample code, the key names are known and they code specifically for them in a predefined order. :bemused:
I'm in a situation where the keynames are not known ahead of time and the user will define the keys to order on. I know this sounds sorta lazy but, I'm looking for a pre-built function that would allow me to pass a array and a string of keys (maybe seperated by commas) to order multi-dimensional (associative) arrays.
This seems like a fairly common practice for this sort (Hey, look! A pun) of array construct but I can't seem to find any direct discussion or code for it.
Any help would be greatly appreciated. :-D
TIA