Skip to content

Instantly share code, notes, and snippets.

@marekkalnik
Created November 28, 2011 13:36
Show Gist options
  • Save marekkalnik/1400418 to your computer and use it in GitHub Desktop.
Save marekkalnik/1400418 to your computer and use it in GitHub Desktop.
Array diff withe one level recursiveness
<?php
$array1 = array(
array('code' => 1, 'quantity' => 2)
);
$array2 = array(
array('code' => 1, 'quantity' => 2)
);
$array3 = array(
array('code' => 1, 'quantity' => 3)
);
(bool) array_udiff($array1, $array2, 'array_diff'); // false
(bool) array_udiff($array1, $array3, 'array_diff'); // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment