Struggling a little to deal with sorting a table by column name. The issues are the data is encrypted so cant just do a sort by the column in the direction needed (ascending descending). So i thought I can use usort but although i can call a function with it i.e. usort( $data, "sortMyData" );
I can't pass the field to sort or it's direction into it. So to do this I would need to write a function to sort for each possible column which is not ideal at all, does anyone know a way i could for instance add another parameter to usort which would contain its property to sort by and it's direction.
Perhaps an alternative would be to decrypt the entire set of data into some memory table but as the data is encrypted and secure i wonder if that would open the way for a vulnerability!
My last option would be to build this into a foreach loop which i could see would make sense but is this the only way?
thanks
Craig