小编use*_*882的帖子

从数组中获取特定键

我有一个带有 2 个相同键的数组,如果可能的话我想查找。当前的代码如下所示:

$arrayName = array(
    1 => array('detail' => 'detail1' , 'detail' => 'detail2')
);

foreach ($arrayName[1] as $key['detail'] => $value) {
     echo $value;
}
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助!

php arrays foreach function

0
推荐指数
1
解决办法
4508
查看次数

标签 统计

arrays ×1

foreach ×1

function ×1

php ×1