$users = [
'name' => ['John', 'George', 'Tom'],
'age' => [32, 25, 44],
];
$users = [
['name' => 'John', 'age' => 32],
['name' => 'George', 'age' => 25],
['name' => 'Tom', 'age' => 44],
];
$keys = array_keys($users);
$result = [];
$size = count($users['name']);
for ($i=0; $i < $size; $i++) {
$row= [];
foreach ($keys as $key) {
$row[$key] = $users[$key][$i];
}
$result[] = $row;
}