function admin_array_diff

6.x admin_array_diff($array1, $array2)
4.x admin_array_diff($array1, $array2)
5.x admin_array_diff($array1, $array2)

I had to create my own version of array_diff, because the built-in PHP version has a nasty bug where it doesn't work after a certain number of elements.

1 call to admin_array_diff()


modules/admin/, line 936


function admin_array_diff($array1, $array2) {

  // Return an array of values from array1 that
  // are NOT in array2.
  // This is my (Richard Peacock) own implementation of array_diff,
  // because something is broken with it, so I am programming
  // my own.
  $rtn = array();
  //for ($t = 0; $t < count($array1); $t++)
  // MUST use foreach instead of for(count($arr))
  // because I did array_unique on it!
  foreach ($array1 as $t => $value) 
    if (in_array($array1 [$t], $array2)) 
    else {
      $rtn [] = $array1 [$t];
  return $rtn;