Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Array
- (
- [aa] => Array
- (
- [location] => USA
- [group] => GroupA
- )
- [bb] => Array
- (
- [location] => USA
- [group] => GroupB
- )
- [cc] => Array
- (
- [location] => Europe
- [group] => GroupA
- )
- [dd] => Array
- (
- [location] => China
- )
- [ee] => Array
- (
- [location] => China
- [group] => GroupA
- )
- [ff] => Array
- (
- [location] => China
- [group] => GroupB
- )
- [gg] => Array
- (
- [location] => China
- [group] => GroupXX
- )
- )
- 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