I\'ve found a few answers to sorting by value, but not key.
What I\'d like to do is a reverse sort, so with:
$nametocode[\'reallylongname\']=\'12
A simple problem requires a simple solution ;-)
arsort($nametocode, SORT_NUMERIC); $result = array_keys($nametocode);