首頁 > 後端開發 > php教程 > 关于php减少数组维度的问题 求大神支招

关于php减少数组维度的问题 求大神支招

WBOY
發布: 2016-06-02 11:33:58
原創
1057 人瀏覽過

php数组

Array
(
[jwc_grades] => Array
(
[0] => Array
(
[2012] => Array
(
[1] => Array
(
[term_point] => 3.5
[term_average] => 88
[grades] => Array
(
[0] => Array
(
[jwc_grade_id] => 5
[course] => 阿什顿
[point] => 2
[grade] => 1
)

<code>                                    )                            )                    )            )        [1] => Array            (                [2012] => Array                    (                        [1] => Array                            (                                [term_point] => 3.5                                [term_average] => 88                                [grades] => Array                                    (                                        [0] => Array                                            (                                                [jwc_grade_id] => 6                                                [course] => 是电风扇等                                                [point] => 2                                                [grade] => 1                                            )                                    )                            )                    )            )        [2] => Array            (                [2012] => Array                    (                        [2] => Array                            (                                [term_point] => 3.5                                [term_average] => 88                                [grades] => Array                                    (                                        [0] => Array                                            (                                                [jwc_grade_id] => 7                                                [course] => 不错                                                [point] => 2                                                [grade] => 1                                            )                                    )                            )                    )            )</code>
登入後複製

)

如何让它变成
Array
(
[jwc_grades] => Array
(

<code>                [2012] => Array                    (                        [1] => Array                            (                                [term_point] => 3.5                                [term_average] => 88                                [grades] => Array                                    (                                        [0] => Array                                            (                                                [jwc_grade_id] => 5                                                [course] => 阿什顿                                                [point] => 2                                                [grade] => 1                                            )                                    )                            )                    )                [2012] => Array                    (                        [1] => Array                            (                                [term_point] => 3.5                                [term_average] => 88                                [grades] => Array                                    (                                        [0] => Array                                            (                                                [jwc_grade_id] => 6                                                [course] => 是电风扇等                                                [point] => 2                                                [grade] => 1                                            )                                    )                            )                    )                 [2012] => Array                    (                        [2] => Array                            (                                [term_point] => 3.5                                [term_average] => 88                                [grades] => Array                                    (                                        [0] => Array                                            (                                                [jwc_grade_id] => 7                                                [course] => 不错                                                [point] => 2                                                [grade] => 1                                            )                                    )                            )                    )</code>
登入後複製

)
就是让它的第三维消失 减少一维

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板