Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.94 KB | None | 0 0
  1. Array
  2. (
  3.     [aa] => Array
  4.         (
  5.             [location] => USA
  6.             [group] => GroupA
  7.         )
  8.     [bb] => Array
  9.         (
  10.             [location] => USA
  11.             [group] => GroupB
  12.         )
  13.     [cc] => Array
  14.         (
  15.             [location] => Europe
  16.             [group] => GroupA
  17.         )
  18.     [dd] => Array
  19.         (
  20.             [location] => China
  21.         )
  22.     [ee] => Array
  23.         (
  24.             [location] => China
  25.             [group] => GroupA
  26.         )
  27.     [ff] => Array
  28.         (
  29.             [location] => China
  30.             [group] => GroupB
  31.         )
  32.     [gg] => Array
  33.         (
  34.             [location] => China
  35.             [group] => GroupXX
  36.         )
  37. )
  38.  
  39. I'd like to sort the above array by [aa]->group ascending but have priority values. For example if GroupC exists it will be top, GroupA it will be second then everything is ascending beyond that and if the group key doesn't exist it's grouped last.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement