I was just wondering if there is a way to use array_multisort to sort by two criteria at the same time. What I have is 14 arrays containing tour information. I use array_multisort to sort by hotel rating like this:
Code: Select all
array_multisort($starRating, $imageUrl, $hotelName, $departureDate, $returnDate, $tripDuration, $packageCode, $tourOperator, $mealPlan, $roomOccupancy, $outputIndex, $sourceCurrency, $supplierLink, $totalPrice);I think it's possible to specify in array_multisort() additional sorting criteria, and I tried it like this:
Code: Select all
array_multisort($starRating, SORT_ASC, $imageUrl, $hotelName, $departureDate, $returnDate, $tripDuration, $packageCode, $tourOperator, $mealPlan, $roomOccupancy, $outputIndex, $taxes, $sourceCurrency, $supplierLink, $totalPrice, SORT_NUMERIC, SORT_ASC);Your help, as always, will be greatly appreciated.
Thank you.
Victor.