order by array like sql php

Solutions on MaxInterview for order by array like sql php by the best coders in the world

showing results for - "order by array like sql php"
Stefano
29 Nov 2018
1$id_group = array();
2$id_group_pos = array();
3
4// Obtain a list of columns
5foreach ($product_list as $key => $row) {
6  $id_group[$key]  = $row['id_group'];
7  $id_group_pos[$key] = $row['id_group_pos'];
8}
9
10// Sort the product_list with id_group ascending then id_group_pos ascending
11array_multisort($id_group, SORT_ASC, $id_group_pos, SORT_ASC, $product_list);
similar questions
queries leading to this page
order by array like sql php