I searched for functions for a while, and even try to understand/use the array_multisort function, but I never managed to get something working on a simple array (like the one above). The new function msort() should be a solution for this.

The function works normally when you use a string for the second parameter. That way the $sort_flag works like you would expect it. When using an array of keys however, a string key is built to sort the array on. This part could use some improvement.

Is there any way to use this to only print some of the key=>value pairs? I have an array with 20 elements, I’m only echoing 3 of them to the web page and I need to order these 3 alphabetically. This is in a 3d array that has been exploded twice and it doesn’t seem to matter what I do I just can’t sort them!

I want to sort the array $cell, but I am only using $cell[2], $cell[11], and $cell[12], is there any way to only sort these 3 after using the explode()?

this worked perfect for simple 2 dimensional arrays but what about some really difficult multidimensional array, for example I have a deep multidimensional array that I cannot get sorted as every example I can find only uses 2 dimensions. It seems like you have a pretty good handle on this, do u have any examples using deeper dimensions arrays? for example, my array is as such:
array (1)
[“car_dealer”] => array(3)
{
[“id”] => string(4) “name”,
[“name] => string(11) “dealer name”,