I am trying to get the title name of an array object.
For example I have
$results[0]['page']
$results[0]['title']
I was wondering if I could use a for loop to loop through the $results[0] array and get the 'page' and 'title' names and insert them into a new array?
Thanks for your time
foreach ($results[0] as $key=>$value) {
//Your key will be page and title, and then the value will be in value
}
More information on the PHP documentation for foreach()
.
Or you could just use array_keys() to turn the assoc indexes into a new array automatically.