I have a two dimensional array like this:
Array
(
[id] => Array
(
[0] => 1
)
[name] => Array
(
[0] => john
)
[dept] => Array
(
[0] => val_1
[1] => val_2
)
[to] => Array
(
[0] => one
[1] => two
)
)
Is there anyway I can convert this array to multiple single arrays like the following:
Array
(
[id] => 1
[name] => john
[dept] => val_1
[to] => one
)
Array
(
[id] => 1
[name] => john
[dept] => val_1
[to] => two
)
Array
(
[id] => 1
[name] => john
[dept] => val_2
[to] => one
)
Array
(
[id] => 1
[name] => john
[dept] => val_2
[to] => two
)
I used array_merge but failed to get what I exactly want. Any help is appreciated