关于一个数组的有关问题,重新组合
程序员文章站
2022-04-15 09:38:07
...
关于一个数组的问题,重新组合
原数组:
我要将这个数组 重新组合,按照时间组合,组合完毕应该是这样的,搞了好久搞不出来。求助,谢谢
原数组:
$arr=array
(
[0] => Array
(
[caseid] => 31
[name] => 张三
[shijian] => Array
(
[0] => 8:00
[1] => 18:00
)
)
[1] => Array
(
[caseid] => 32
[name] => 李四
[shijian] => Array
(
[0] => 8:00
[1] => 12:00
[2] => 18:00
)
)
[2] => Array
(
[caseid] => 33
[name] => 王五
[shijian] => Array
(
[0] => 8:00
[1] => 12:00
[2] => 18:00
)
)
)
我要将这个数组 重新组合,按照时间组合,组合完毕应该是这样的,搞了好久搞不出来。求助,谢谢
Array
(
[0] => Array
(
[time] => 8:00
[detail] => Array
(
[0] => Array
(
[caseid] => 31
[casename] => 张三
)
[1] => Array
(
[caseid] => 32
[casename] =>李四
)
[2] => Array
(
[caseid] => 33
[casename] => 王五
)
)
)
[1] => Array
(
[time] => 12:00
[detail] => Array
(
[0] => Array
(相关文章
相关视频
下一篇: shell常用命令