Guest User

Untitled

a guest
Feb 22nd, 2012
84
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function removeDuplicates(array $aArray)
  2. {
  3.     $aResult = array();
  4.     $aTemp = array();
  5.     foreach($aArray AS $sKey => $sValue )
  6.     {
  7.         if (isset($aTemp[$sValue]))
  8.         {
  9.             unset($aResult[$aTemp[$sValue]]);
  10.         } // if
  11.         else
  12.         {
  13.             $aTemp[$sValue] = $sKey;
  14.             $aResult[$sKey] = $sValue;
  15.         } // else  
  16.     } // foreach
  17.  
  18.     return $aResult;
  19. } // function
RAW Paste Data