Posted By

chupzzz on 03/02/12


php diff compare

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


PHP array_diff() full comparison

 / Published in: PHP


PHP built-in function array_diff($one, $two) working in one-way only: it not will return new elements from $two. This simple function do that.

  1. <?php
  2. function fullArrayDiff($left, $right) {
  3. return array_diff(array_merge($left, $right), array_intersect($left, $right));
  4. }
  5. ?>

Report this snippet  

You need to login to post a comment.