Home > Backend Development > PHP Tutorial > 关于一个数组的有关问题,重新组合

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

WBOY
Release: 2016-06-13 12:07:58
Original
819 people have browsed it

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

<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 />
Copy after login


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

<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>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template