Hi all! Can you please help me with an array sorting issue? I have an array $products[$fields] where I would like to sort decreasing by $products[‘form_to_comparison’] and maintain all [$fields] key associations. So, the product with the highest form_to_comparison value will be $products[‘form_to_comparison’][0], and other vlues for the same product would be $products[‘name’][0] or $products[‘price’][0]
Each field can’t be sorted independently, because each key (e.g. [0]. [1]. [2]…) is associated with a particular product. I’d like form_to_comparison to be sorted descending, and then all of the other fields’ keys need to follow form_to_comparison to be in the same sequence. So whatever has the highest form_to_comparison needs to be $products[‘pid’][0], $products[‘name’][0], etc. There are lots of fields, and pid and name are merely examples.