Multidimensional array sort?

Use ksort($projectsByYear)

Of course every time you add something to the array it will need to be resorted.