0
我有一個多維數組,如下所示,我只想獲得底部[image_meta]數組中的[caption]的值。多維數組foreach
Array
(
[file] => 2014/01/dreamstimecomp_5449062.jpg
[sizes] => Array
(
[thumbnail] => Array
(
[file] => dreamstimecomp_5449062-150x150.jpg
)
[medium] => Array
(
[file] => dreamstimecomp_5449062-300x224.jpg
)
)
[image_meta] => Array
(
[aperture] => 0
[credit] =>
[camera] =>
[caption] =>
[created_timestamp] => 0
[copyright] =>
[focal_length] => 0
[iso] => 0
[shutter_speed] => 0
[title] =>
)
)
我已經試過這下面的每個循環,但不工作
echo '<pre>';
print_r($caption_data);
echo '</pre>';
foreach ($caption_data as $x=>$x_value){
echo $x[0][3];
}
'var_dump($ x);'每當你不知道變量是什麼時,使用'var_dump' – zerkms