fork(1) download
  1. <?php
  2.  
  3. $array1 = array(
  4. '2013-05-01'=>'test',
  5. '2013-05-02'=>'testing',
  6. '2013-05-03'=>'working',
  7. '2013-05-04'=>'future test');
  8.  
  9. $array2 = array(
  10. '2013-05-01'=>'1',
  11. '2013-05-02'=>'done',
  12. '2013-05-03'=>'code',
  13. '2013-05-05'=>'release');
  14.  
  15.  
  16. $r = array_map(function($i) {
  17. return !is_array($i) ? $i : implode(' ', $i);
  18. }, array_merge_recursive($array1, $array2));
  19.  
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
array(5) {
  ["2013-05-01"]=>
  string(6) "test 1"
  ["2013-05-02"]=>
  string(12) "testing done"
  ["2013-05-03"]=>
  string(12) "working code"
  ["2013-05-04"]=>
  string(11) "future test"
  ["2013-05-05"]=>
  string(7) "release"
}