I'm trying to sort a large array based on a column of orders. The way the array is built doesn't allow me to do much in the query to sort, but I would like to know if there is a way that's faster than array_multisort() in PHP?
My code is:
foreach ($returnArr as $key => $row) {
$tmp[$key] = $row['orders'];
}
array_multisort($tmp, SORT_DESC, $returnArr);
I'm also up for suggestions on how I can build a single query and have some of my where conditions only apply to a single column. If this is possible, then I would just be able to do it with MySQL rather than PHP.