以下是一个名为$form_data
的多维数组:
Array
(
[form_submitted] => yes
[teacher_id] => 3807f31f8c4357bbb56662047529dcde
[cs_map_ids] => Array
(
[0] => 144
[1] => 130
[2] => 131
[3] => 67
[4] => 89
)
[btn_submit] => Done
)
我只想使用foreach循环访问键[cs_map_ids]
的值。但无法访问数组[cs_map_ids]
内的值。谁能帮助我,我应该如何访问这些值一个一个使用foreach循环?
应该很直接,试试
foreach($form_data['cs_map_ids'] as $map_id)
{
echo $map_id;
}
foreach ($form_data['cs_map_ids'] as $d) echo "$d<br />";