6.2.5 PHP二维数组

6.2.5 PHP二维数组

test.php

<?php
/*
 *  二维数组  (数组的数组)
 *
 *
 */



    //              0     1      2

    $group = array(
        array("name"=>"zs", "age"=>20, "sex"=>"男", "email"=>"aaa@bbb.com"), 
        array("name"=>"ls", "age"=>21, "sex"=>"女", "email"=>"bbb@bbb.com"), 
        "three"=>array("name"=>"ww", "age"=>22, "sex"=>"男", "email"=>"cccc@bbb.com")
    );

    

//  var_dump(  $group[1]  );


/*  $arr = $group[1];

    echo $arr['email'];

 */

    //echo $group[1]['email'];
    
    echo $group['three']['name'];


    原文作者:caoyuan
    原文地址: https://www.jianshu.com/p/f170d77a52d4
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞