Skip to content

Instantly share code, notes, and snippets.

@aonic
Created January 6, 2014 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aonic/8290062 to your computer and use it in GitHub Desktop.
Save aonic/8290062 to your computer and use it in GitHub Desktop.
[9] boris> $hits;
→ array(
0 => array(
'hit' => array(
'name' => 'Alice'
)
),
1 => array(
'hit' => array(
'name' => 'John'
)
),
2 => array(
'hit' => array(
'name' => 'James'
)
),
3 => array(
'hit' => array(
'name' => 'Reddit'
)
)
)
[10] boris> $names = iter\map(iter\fn\deep_index('hit.name'), $hits);
[11] boris> iter\toArray($names);
→ array(
0 => 'Alice',
1 => 'John',
2 => 'James',
3 => 'Reddit'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment