PHP面试题之取出二维数组下的值!

多维数组怎么取值

$sites = array 
( 
    "runoob"=>array 
    ( 
        "菜鸟教程", 
        "http://www.runoob.com" 
    ), 
    "google"=>array 
    ( 
        "Google 搜索", 
        "http://www.google.com" 
    ), 
    "taobao"=>array 
    ( 
        "淘宝", 
        "http://www.taobao.com" 
    ) 
); 

先面试取出二维数组

echo $sites['runoob'][0] . '地址为:'.$sites['runoob'][1];

为您推荐

评论已关闭