$arr_place=arry('beijing'=>"The capital of China.",少了一个a   ==> array

解决方案 »

  1.   

    一个错误为上所说你少打一个a应为array
    另一个就是你在给数组赋值时他下面的跟上面是一体的你不能用回车分开.'shanghai'=>"The biggest commecial city in China.",有回车错.
          'shenzheng'=>"The window of the worldforChina." 修改以后的代码.下面的你看看吧.<html>
    <head>
    <title>數組數據設定實例</title>
    </head>
    <body>
    <?php
    $arr_place=array('beijing'=>"The capital of China.",      'shanghai'=>"The biggest commecial city in China.",      'shenzheng'=>"The window of the worldforChina."         );                 
    print_r($arr_place);//显示
    //遍历数组.
    foreach($arr_place as $key=>$val) {
    print "<BR>".$key."=>".$val;
    }
    ?>
    </body>
    </html>