Blogger Information
Blog 61
fans 1
comment 0
visits 69788
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
0604-PHP数组遍历
我的博客
Original
613 people have browsed it

实例

<?php

$movies = [
    [
        'mov_id'=>1,
        'name'=>'倚天屠龙记',
        'image'=>'yttlj.jpg',
        'detail'=>'元朝末年,群雄纷起,武林动荡。江湖传闻,得到屠龙刀倚天剑者,可以成为武林至尊,号令天下,莫敢不从。一时间风云四起,引发了武林中对屠龙刀倚天剑的争夺,几段姻缘和孽缘也由此产生。武当派张翠山与天鹰教殷素素…	',
        'cate_id'=>1
    ],

    [
        'mov_id'=>2,
        'name'=>'都挺好',
        'image'=>'dth.jpg',
        'detail'=>' 苏母的的突然离世打破了这个家庭外表的平静,意想不到的隐患层层显露,对毫无主见却又自私、小气的苏父的安置和后续生活问题,引发了远在国外的大哥与本城的二哥、小妹三家规律生活的不再。一直被苏母压制的苏父翻…	',
        'cate_id'=>1
    ],

  ];

//遍历一个二维数组。
foreach ($movies as $movie){
    foreach ($movie as $ok){
        echo  "<p style='color: lightseagreen;background-color:darkred;'>'{$ok}'</p>";
//        echo  '<br>';

    }

}

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post