日期:2014-05-17  浏览次数:20527 次

php循环的一个问题
有这样一个数组 
PHP code
Array
(
    [0] => Array
        (
            [id] => 1
            [name] => ~core
            [title] => 项目
            [_child] => Array
                (
                    [0] => Array
                        (
                            [id] => 2
                            [name] => home
                            [title] => 主页分组
                            [_child] => Array
                                (
                                    [0] => Array
                                        (
                                            [id] => 3
                                            [name] => index
                                            [title] => 首页模块
                                            [_child] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [id] => 5
                                                            [name] => index
                                                            [title] => 项目首页
                                                        )

                                                )

                                        )

                                    [1] => Array
                                        (
                                            [id] => 4
                                            [name] => user
                                            [title] => 用户模块
                                            [_child] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [id] => 6
                                                            [name] => index
                                                            [title] => 用户首页
                                                        )

                                                    [1] => Array
                                                        (
                                                            [id] => 7
                                                            [name] => login
                                                            [title] => 登陆首页
                                                        )

                                                    [2] => Array
                                                        (
                                                            [id] => 8
                                                            [name] => logout
                                                            [title] => 登出
                                                        )

                                                )

                                        )

                                )

                        )

                    [1] => Array
                        (
                            [id] => 9
                            [name] => company
                            [title] => 公司分组
                            [_child] => Array
                                (
                                    [0] => Array
                                        (
                                            [id] => 11
                                            [name] => index
                                            [title] => 公司模块
                                            [_child] => Array
                                                (