Php 从arrray中查找特定密钥?
我有一个这样的数组Php 从arrray中查找特定密钥?,php,mysql,Php,Mysql,我有一个这样的数组 [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 organi
[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”
请帮我渡过难关。。提前谢谢 使用
foreach
并将键绑定到变量:
foreach($someArray as $key => $value) {
echo $key;
}
其中(根据您的问题)我假设multiple\u name
和multiple\u correct
不是嵌套数组,如果它们是嵌套数组,尽管您需要foreach
两次:
foreach($containerArray as $innerArray) {
foreach($innerArray as $key => $value) {
echo $key;
}
}
是的,它们是嵌套数组,我只想打印上面这些数组的键,这样我就可以存储它们,然后比较它们的代码。