Sort by predefined order:
Sometimes you might want to group form elements in arrays. Here’s a way to do that: The structure of the $_POST array will then be:
Simple way to sort an array with usort on a specific value using a comparator.
Put this in a static class. This will apply to Lists of any type. Simply call it like this