2012-03-06 13 views
2

私が行うときPHPの配列出力混乱

var_dump($galleryCategoriesThumb); 

出力は

array(1) { 


[0]=> 
    array(1) { 
    ["Gallery"]=> 
    array(3) { 
     ["id"]=> 
     string(3) "190" 
     ["photofile"]=> 
     string(6) "50.jpg" 
     ["gallery_category_id"]=> 
     string(2) "58" 
    } 
    } 
} 

私は

var_dump($galleryCategoriesThumb["photofile"]); 

を行うと、私はNULL出力を得ることです。私は様々なオプションも試しました。 私がしたいのは、echo ["photofile"]です。助けてください。

答えて

3

"で、photoFile" キーが$ galleryCategoriesThumbに存在しないためのvar_dump($ galleryCategoriesThumb [ "で、photoFileは"])はNULLを返していることが予想される$galleryCategoriesThumb[0]['Gallery']["photofile"]

+1

それは働いた。どうもありがとうございました。 – nepalipunk

1

お試しvar_dump($galleryCategoriesThumb[0]["Gallery"]["photofile"]);

3次元配列です。

+1

で掲載され、あなたはそれが働いた配列の「フル・パス」を必要とします。どうもありがとうございました。 – nepalipunk

1

を試してみてください。 「で、photoFile」にアクセスするには

他人

var_dump($galleryCategoriesThumb[0]["Gallery"]["photofile"]);. 
+0

ありがとうございます。 – nepalipunk