I have an array that looks like this:
Array
(
[0] => Array
(
[name] => stories
[results] => Array
(
[0] => Array
(
[id] => 1
)
[1] => Array
(
[id] => 2
)
)
)
[1] => Array
(
[name] => users
[results] => Array
(
[0] => Array
(
[id] => 1
)
[1] => Array
(
[id] => 2
)
)
)
)
This array is stored in a variable called $fql. I want to access the results with the name stories. I could just do:
$stories = $fql['0']['results']
However, it seems a bit odd selecting the array by an index number and not the name of the array.
Is there any other way I can access the results in the array alongside [name] => stories?
Try this:
This will put the results into two variables,
$storiesand$users;