Here's the situation: I have 2 arrays like so:
<?php
$array1 = [
'key1' => 437776,
'key2' => 'Bar',
'key3' => ''
];
$array2 = [
'key1' => '',
'key2' => 'Bar',
'key3' => 'Foo'
];
What I actually want is a magic_function
that takes as params $array1
and $array2
, and returns an array that does not contains any empty value (the values should be obtained from $array1
and $array2
). In this case it will be:
$array_returned = [
'key1' => 437776,
'key2' => 'Bar',
'key3' => 'Foo'
];
Thanks in advance