removing all duplicate values from an array

From: Allowee (Vincent_at_GeversXL.nl)
Date: 10/30/03


To: php-general@lists.php.net
Date: Thu, 30 Oct 2003 18:27:51 +0100

Hi,

I'm looking for a function that does almost the same as array_unique()

But it must also delete the other duplicate entry.

sample to explain:

array(
'a' => 'one',
'b' => 'one',
'c' => 'zero',
'd' => 'two'
);

I now want the result to be:

array(
'c' => 'zero',
'd' => 'two'
);

This way I will be able to do an array_diff and then see all the duplicate
entries listed.

this is to find dup. ip address for a hosting system,
displaying both accounts will make it easy to trace the amount of accounts 1
ip curruntly has.

Anybody know how to do this?

Thanks,
Allowee



Relevant Pages

  • Another Golf Handicap Question
    ... I'm trying to loop through a golf "scorecard" to find if a duplicate entry ... was made for an entry in the handicap field. ... is located anywhere else in the array and then use a message to that effect. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Finding Login Hours for user accounts in AD
    ... The logonHours attribute is a byte array. ... Accounts with logon hours set will display in the format; ... created by copying other user accounts and retain the same properlys. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Finding Login Hours for user accounts in AD
    ... The logonHours attribute is a byte array. ... Accounts with logon hours set will display in the format; ... created by copying other user accounts and retain the same properlys. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Array and InputBox Integration ?
    ... I am having a little trouble getting values of an array to number ... themselves in an InputBox for a user to make their choice. ... I am pulling all the local accounts off the machine which will vary ... Sub ListLocalAccounts ...
    (microsoft.public.scripting.wsh)
  • Re: Vlookup with Multiple Criteria
    ... will return an array of true/falses--depending on if A2 is equal ... I have 2 spreadsheets that both contain store numbers and the accounts they ... I usually use the VLOOKUP formula to search for the store numbers in the ...
    (microsoft.public.excel.newusers)