fork(1) download
  1. <?php
  2.  
  3. $array1 = array('wallace', 'wayne', 'marcos');
  4.  
  5. $array2 = array('cleber', 'wallace', 'junior');
  6.  
  7.  
  8. var_dump(array_unique(array_merge($array1, $array2)));
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
array(5) {
  [0]=>
  string(7) "wallace"
  [1]=>
  string(5) "wayne"
  [2]=>
  string(6) "marcos"
  [3]=>
  string(6) "cleber"
  [5]=>
  string(6) "junior"
}