我有一个看起来像这样的数组:
$example = [
['rendered'][0]['rendereditem1']
['rendered'][4]['rendereditem2 and more']
['rendered'][2]['rendereditem3']
]
现在我想迭代foreach
以获取 0,4,2 的内容!
通常我会写:
foreach($example as $value){
print $value['rendered'][int which is the same everywhere];
}
但这显然不起作用,因为数组名称总是不同的......在这种情况下我怎么能迭代?