Array_Rows_to_Columns
This is a short routine to make a 2 dimensional array sortable by up to 6 fields (using the array_multisort command). My main purpose in writing this module was to make it quick and simple to sort an array and avoid poring through the help file each time to figure it out. Before I put this together, I downloaded and tested a couple of array sort routines and couldn't get them to work for my array. The key problem is that the most common array structure has a primary key / dimension (that is often used as an index number) and a secondary array containing fields within each primary index entry. This looks like:
This does not lend itself to sorting on anything other than the primary key / index. There is a way to get around this so we can use fields such as first_name and last_name in the above example as sort fields. The module that I have developed simplifies the setup to do this.