- array_map: documentation ( source)
- array_combine: documentation ( source)
- var_export: documentation ( source)
- array_values: documentation ( source)
- array_keys: documentation ( source)
<?php
$arr = [
'name' => ['a', 'b', 'c'],
'age' => [ 2 , 1 , 3 , 4 ],
'shoe' => [11 , 9 ],
'kids' => [ 1 , 0 , 2 ]
];
$keys = array_keys($arr);
$transposed = array_map(null, ...array_values($arr));
foreach ($transposed as &$subarray) {
$subarray = array_combine($keys, $subarray);
}
var_export($transposed);