I have the following array like so
$foo = [
a => 0,
b => 0,
c => 0,
d => 0
];
$bar = [
c => 3,
]
How can I merge $foo and $bar in such a way that the output is like this
$foobar = [
a => 0,
b => 0,
c => 3,
d => 0
]
I have tried array_diff and array_intersect but didn't get any result.