Created
December 12, 2014 14:30
-
-
Save arioch1984/31e9c31e1d609ddf7ca1 to your computer and use it in GitHub Desktop.
Get column from associative array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function array_col(array $a, $x) | |
{ | |
return array_map(function($a) use ($x) { return $a[$x]; }, $a); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment