PHP数组访问数组对象的标题名
我正在尝试获取数组对象的标题名 比如我有PHP数组访问数组对象的标题名,php,arrays,Php,Arrays,我正在尝试获取数组对象的标题名 比如我有 $results[0]['page'] $results[0]['title'] 我想知道是否可以使用for循环遍历$results[0]数组,获取“page”和“title”名称并将它们插入到新数组中 谢谢你的时间 foreach ($results[0] as $key=>$value) { //Your key will be page and title, and then the value will be in value
$results[0]['page']
$results[0]['title']
我想知道是否可以使用for循环遍历$results[0]数组,获取“page”和“title”名称并将它们插入到新数组中
谢谢你的时间
foreach ($results[0] as $key=>$value) {
//Your key will be page and title, and then the value will be in value
}
有关的详细信息。,或者您可以使用它将关联索引自动转换为新数组