我有一个像这样的数组
[multiple_name] => Array
(
[0] => Change the business unit\'s root business unit
[1] => Change the business unit\'s parent business unit
[2] => Copy the business unit to the new position in the organizational hierarchy.
[3] => Disable the business unit, change the business unit s organization team and then activate the business unit
)
[multiple_correct] => Array
(
[1] => yes
)
现在我想只打印此数组中的键/索引值,如'0,1,2,3'和下一个'1'。
请提前通过这个帮助我.. thanx !!
答案 0 :(得分:0)
使用foreach
并将键绑定到变量:
foreach($someArray as $key => $value) {
echo $key;
}
我认为(根据您的问题)multiple_name
和multiple_correct
不是嵌套数组,如果它们需要foreach
两次:
foreach($containerArray as $innerArray) {
foreach($innerArray as $key => $value) {
echo $key;
}
}