Created
February 18, 2016 22:22
-
-
Save slifin/bbff99ab53ed61b0199c to your computer and use it in GitHub Desktop.
This file contains 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 transposeC($matrix) { | |
return array_map( | |
(new _)->curry(function ($v, $k, $matrix) { | |
return array_column($matrix, $k); | |
}, (new _), (new _), $matrix), | |
$matrix[0], array_keys($matrix[0])); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment