sort array multiple field by select field sort

$tmp = Array();
foreach($result["data"] as &$ma)
      $tmp[] = &$ma["app_id"];
array_multisort($tmp,SORT_ASC,$result["data"]);

In above example $result["data"] is an array multiple field and sort by app_id field asc(SORT_ASC) or you want sort by desc(SORT_DESC)

http://uk.php.net/manual/en/function.array-multisort.php

Related posts:

This entry was posted in knowledge, php. Bookmark the permalink.