首頁 > 後端開發 > php教程 > 诡异事件,数组有关问题

诡异事件,数组有关问题

WBOY
發布: 2016-06-13 13:27:22
原創
935 人瀏覽過

诡异事件,数组问题

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->

$list=Array
(
    [page] => Array
        (
            [page_id] => 1,
            [path] => tiyee.html,
            [templates] => zj001.tpl,
            [key] => 21212121,
        ),

    [qianggou] => Array
        (
            [object_id] => 1,
            [number] => 0,
            [oldprice] => 0.00,
            [newprice] => 0.00,
            [begintime] => 0000-00-00 00:00:00,
            [endtime] => 0000-00-00 00:00:00,
            [limit_b] => 0000-00-00 00:00:00,
            [limit_e] => 0000-00-00 00:00:00,
            [type] => 1,
            [saleout] => 0,
            [classtime] => 0000-00-00 00:00:00,
            [page_id] => 1,
        ),

    [miaosha] => Array
        (
            [object_id] => 2,
            [number] => 0,
            [oldprice] => 0.00,
            [newprice] => 0.00,
            [begintime] => 2010-04-18 23:42:10,
            [endtime] => 2010-04-18 23:42:10,
            [limit_b] => 2010-04-18 23:42:10,
            [limit_e] => 2010-04-18 23:42:10,
            [type] => 2,
            [saleout] => 0,
            [classtime] => 0000-00-00 00:00:00,
            [page_id] => 1,
        )

)

echo '<pre class="brush:php;toolbar:false">';
print_r($list['page']);





登入後複製

结果为什么是1?明明应该是个数组啊?

------解决方案--------------------
PHP code
$list=array(
    'page' => array (
            'page_id' => 1,
            'path' => 'tiyee.html',
            'templates' => 'zj001.tpl',
            'key' => 21212121
        )
);
print_r($list['page']); <div class="clear">
                 
              
              
        
            </div>
登入後複製
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板