Skip to content

Instantly share code, notes, and snippets.

@colindecarlo
Created February 13, 2016 17:22
Show Gist options
  • Save colindecarlo/a480438e9cd9ad521bed to your computer and use it in GitHub Desktop.
Save colindecarlo/a480438e9cd9ad521bed to your computer and use it in GitHub Desktop.
<?php
function transpose($matrix) {
return array_map(function ($column) use ($matrix) {
return array_column($matrix, $column);
}, array_keys($matrix[0]));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment