Reputation: 8705
I have array like this:
array(2) {
[0]=> array(1) {
["name"]=> string(8) "TestName"
}
[1]=> array(1) {
["surname"]=> string(6) "iljado"
}
}
and I need it to be like this:
array(2) {
["name"]=> string(8) "TestName" ,
["surname"]=> string(6) "iljado"
}
How can I do this?
Upvotes: 1
Views: 46
Reputation: 78994
Recursively merge them:
$array = call_user_func_array('array_merge', $array);
Upvotes: 5