Skip to content

Instantly share code, notes, and snippets.

@glennpratt
Created January 13, 2015 22:38
Show Gist options
  • Select an option

  • Save glennpratt/21580716e10c0b25a398 to your computer and use it in GitHub Desktop.

Select an option

Save glennpratt/21580716e10c0b25a398 to your computer and use it in GitHub Desktop.
[1] boris> $things = ['foo' => 'bar', 'baz' => 'qux'];
→ array(
'foo' => 'bar',
'baz' => 'qux'
)
[2] boris> array_map(function($thing) { return "{$thing}s";}, $things);
→ array(
'foo' => 'bars',
'baz' => 'quxs'
)
[3] boris>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment