A while back, I posted a function here that sorts an array of arrays, like that returned by mysql_assoc_array. I've redone it as part of a new data object class I'm developing for my php framework and added it to my google code repository. Find it here: