title: Best way to sort an array in PHP using a key-function?
body: <p><i>usort</i> and <i>uasort</i> use a comparison function which is slow because it must be computed every time a comparison is needed between to elements of an array. Other languages, like Python, let you sort an array using a key function which gets evaluated only once per element in the array. What's the best way to do this in PHP?</p>