fork(1) download
  1. <?php
  2.  
  3. $array1 = array('我', '很', '好', '阿');
  4. $array2 = array('我', '真', '的', '@很', '@好');
  5. $array3 = array();
  6. foreach ($array1 as $el) {
  7. $check = false;
  8. foreach ($array2 as $el2) {
  9. if (strpos($el2, $el)){
  10. $check = true;
  11. array_push($array3, $el2);
  12. }
  13. }
  14. if (!$check) {
  15. array_push($array3, $el);
  16. }
  17. }
  18. var_dump($array3);
Success #stdin #stdout 0s 82560KB
stdin
Standard input is empty
stdout
array(4) {
  [0]=>
  string(3) "我"
  [1]=>
  string(4) "@很"
  [2]=>
  string(4) "@好"
  [3]=>
  string(3) "阿"
}