我在PHP中具有以下数组:
Array
(
[CA] => Array
[country] => Canada
(
[0] => Array
(
[name] => BSB
[example] => 123456
[length] => 6 characters
)
[1] => Array
(
[name] => Account Number
[example] => 12345678
[length] => 6 to 10 characters
)
)
)
如何在不回显国家名称[country] => Canada
的情况下循环到此数组中?
实际上,我有这个:
foreach($array['CA'] as $key => $value) {
...
}
但是会打印国家名称。
谢谢。
答案 0 :(得分:1)
我们可以这样吗
foreach($array['CA']['country'] as $key => $value) {
...
}
相反,
foreach($array['CA'] as $key => $value) {
...
}