Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2012
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement