ichadhr
10/14/2019 - 8:15 AM

in_array multidimensional

function in_array_r($needle, $haystack, $strict = false) {
  foreach ($haystack as $item) {
    if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) {
      return true;
    }
  }
return false;
}

// sample
foreach ($array as $k => $v) {
  $val = $v['num_invoice'];
  
  if(!in_array_r($val, $array2))
  {
    // return true
  }
}