$aProduct = Array ( 0=> array (' goods_id ' = 1, ' name ' = ' iPhone 4 ', ' Is_group ' =>4), 1=> Array (' goods_id ' + 2, ' name ' = ' iphone 4s ', ' is_group ' =>6, 2=> Array (' goods_id ' = + 3, ' name ' = ' + ' iphone 5 ') , ' Is_group ' =>1), 3=> Array (' goods_id ' = 4, ' name ' = ' iPhone 5s ', ' Is_group ' =>1)); function ArraySort ($multi _array, $sort _key, $sort =sort_asc) { if (Is_array ($multi _array)) { foreach ($multi _array as $ Row_array) { if (Is_array ($row _array)) { $key _array[] = $row _array[$sort _key]; } else{ return false;}} } else{ return false; } Array_multisort ($key _array, $sort, $multi _array); return $multi _array;} Print_r (ArraySort ($aProduct, ' Is_group ', Sort_desc)); exit;
Http://www.ruesin.com/php/array_multisort-12.html
The above describes the PHP multi-dimensional array sorting, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.