首页 >后端开发 >php教程 >关于一个数组的有关问题,重新组合

关于一个数组的有关问题,重新组合

WBOY
WBOY原创
2016-06-13 12:07:58807浏览

关于一个数组的问题,重新组合
原数组:

<br />$arr=array<br />(<br />    [0] => Array<br />        (<br />            [caseid] => 31<br />            [name] => 张三<br />            [shijian] => Array<br />                (<br />                    [0] => 8:00<br />                    [1] => 18:00<br />                )<br /><br />        )<br /><br />    [1] => Array<br />        (<br />            [caseid] => 32<br />            [name] => 李四<br />            [shijian] => Array<br />                (<br />                    [0] => 8:00<br />                    [1] => 12:00<br />                    [2] => 18:00<br />                )<br /><br />        )<br /><br />    [2] => Array<br />        (<br />            [caseid] => 33<br />            [name] => 王五<br />            [shijian] => Array<br />                (<br />                    [0] => 8:00<br />                    [1] => 12:00<br />                    [2] => 18:00<br />                )<br /><br />        )<br /><br />)<br />


我要将这个数组 重新组合,按照时间组合,组合完毕应该是这样的,搞了好久搞不出来。求助,谢谢

<br>Array<br>(<br>    [0] => Array<br>        (<br>            [time] => 8:00<br>            [detail] => Array<br>                (<br>                    [0] => Array<br>                        (<br>                            [caseid] => 31<br>                            [casename] => 张三<br>                            <br>                        )<br>					[1] => Array<br>						(<br>							[caseid] => 32<br>							[casename] =>李四<br>							<br>						)<br>					[2] => Array<br>						(<br>							[caseid] => 33<br>							[casename] => 王五<br>							<br>						)<br><br>                )<br><br>        )<br><br>    [1] => Array<br>        (<br>            [time] => 12:00<br>            [detail] => Array<br>                (<br>                    [0] => Array<br>                        (<div class="clear">
                 
              
              
        
            </div>
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn