Skip to content

Instantly share code, notes, and snippets.

@am-
Created November 11, 2016 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save am-/0bc907a97d3e9e4923396fcebee9808e to your computer and use it in GitHub Desktop.
Save am-/0bc907a97d3e9e4923396fcebee9808e to your computer and use it in GitHub Desktop.
<?php
$data = [
'name' => ['a', 'b', 'c'],
'email' => ['a@bc.de', 'x@yz.de', 'barde@bar.de'],
];
$output = [];
for($i = 0; $i < count($data['name']); $i++) {
$output[] = array_combine(array_keys($data), array_column($data, $i));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment