Update

I recently answered this question in a much more capable manner in the "definitive" topic on sorting multidimensional arrays. The answer below targets old versions of PHP (5.2 and earlier); while the concept is sound, nowadays there are much better ways of doing things. Read the answers on other question instead.

Original (very outdated) answer

usort is there for exactly this situation. If you also need keys to be preserved, the appropriate function would be uasort.