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
I'm looking for a function that does almost the same as array_unique()
But it must also delete the other duplicate entry.
snip
Untested pseudo-PHP follows -
$encountered_elements = array();
foreach($original_array as $key = $val)
if(in_array($val,
: Thursday, October 30, 2003 10:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] removing all duplicate values from an array
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
I'm looking for a function that does almost the same as array_unique()
But it must also delete the other duplicate entry.
snip
Untested pseudo-PHP follows -
$encountered_elements = array();
foreach($original_array as $key = $val)
if(in_array($val,
On Thursday 30 October 2003 20:37, Mike Migurski wrote:
I'm looking for a function that does almost the same as array_unique()
But it must also delete the other duplicate entry.
snip
Untested pseudo-PHP follows -
$encountered_elements = array();
foreach($original_array as
-Original Message-
From: Mike Migurski [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 30, 2003 1:37 PM
To: Allowee
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] removing all duplicate values from an array
I'm looking for a function that does almost the same as
array_unique
array(
'a' = 'one',
'b' = 'one',
'c' = 'zero',
'd' = 'two'
);
through this and am having a hind time with then logic... Could you
explain how the output would be array('c' = 'zero', 'd' = 'two')??
I was being pretty sloppy with the code (should've posted pseudocode to
begin with, my bad) but
7 matches
Mail list logo