Skip to content

Instantly share code, notes, and snippets.

@BinaryKitten
Last active December 13, 2015 19:08
Show Gist options
  • Select an option

  • Save BinaryKitten/4959883 to your computer and use it in GitHub Desktop.

Select an option

Save BinaryKitten/4959883 to your computer and use it in GitHub Desktop.
<?php
function array_keyValue($array, $key) {
return array_map(
function($item) use ($key) {
if (!is_array($item)) {
return null
} elseif (!array_key_exists($key, $item)) {
return null;
}
return $item[$key];
},
$array
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment