二维数组排序这个要如何做
程序员文章站
2022-06-07 22:23:09
...
二维数组排序这个要怎么做?
Array
(
[0] => Array
(
[userid] => 123707
[username] => qycntest
[realname] => 企业开发
[sex] => 3
[departname] =>
)
[1] => Array
(
[userid] => 123725
[username] => devtest-23
[realname] => nn
[sex] => 1
[departname] => 17c
[creator] => 1
)
[2] => Array
(
[userid] => 123726
[username] => devtest-24
[realname] => oo
[sex] => 1
[departname] => 测试部
[isManager] => 1
)
[3] => Array
(
[userid] => 123728
[username] => devtest-26
[realname] => qq
[sex] => 1
[departname] => 测试部
[isManager] => 1
)
[4] => Array
(
[userid] => 123732
[username] => devtest-30
[realname] => uu
[sex] => 1
[departname] => 测试部
)
)
我要把有isCreator的项的排在最前面,其次是isManager=1排在后面,最后就是普通用户,请教下大家! 谢谢
------解决方案--------------------
Array
(
[0] => Array
(
[userid] => 123707
[username] => qycntest
[realname] => 企业开发
[sex] => 3
[departname] =>
)
[1] => Array
(
[userid] => 123725
[username] => devtest-23
[realname] => nn
[sex] => 1
[departname] => 17c
[creator] => 1
)
[2] => Array
(
[userid] => 123726
[username] => devtest-24
[realname] => oo
[sex] => 1
[departname] => 测试部
[isManager] => 1
)
[3] => Array
(
[userid] => 123728
[username] => devtest-26
[realname] => qq
[sex] => 1
[departname] => 测试部
[isManager] => 1
)
[4] => Array
(
[userid] => 123732
[username] => devtest-30
[realname] => uu
[sex] => 1
[departname] => 测试部
)
)
我要把有isCreator的项的排在最前面,其次是isManager=1排在后面,最后就是普通用户,请教下大家! 谢谢
------解决方案--------------------
相关文章
相关视频