Skip to content

Instantly share code, notes, and snippets.

@stephpy
Created July 27, 2012 10:53
Show Gist options
  • Save stephpy/3187406 to your computer and use it in GitHub Desktop.
Save stephpy/3187406 to your computer and use it in GitHub Desktop.
array_diff ...
<?php
function array_diff_simple($a, $b)
{
$r = array();
foreach($a as $key => $val) {
if(!isset($b[$key])) {
$r[$key] = $val;
} else {
if(is_array($b[$key]) && !is_array($val)) {
$r[$key] = $val;
}
}
}
return $r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment