Re: Arrays Data

From: Date: Mon, 24 Sep 2001 02:54:38 +0000
Subject: Re: Arrays Data
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-68470@lists.php.net to get a copy of this message
At 07:00 23/9/2001 -0700, you wrote:
hi how can I remove duplicted values (Data) in my array ?
there are several solutions to this problem, you can: 1 - use the function array_count_values() to find all the values that occur more then once and then loop trough the result array and removing all the duplicates. 2 - you can copy you array to a new one, but only copy values that aren't there... something like.. $your_array; $new_array=array(); // this is the one that should have no copies... foreach($your_array as $value) {
        if( !in_array($value,$new_aray) )
        {
                $new_array[]=$value;
        }
} at the end of this loop $new_array contains all data from $your_array with no duplicates... _____________________________ . Christian Dechery . . Gaita-L Owner / Web Developer . . http://www.webstyle.com.br . . http://www.tanamesa.com.br

« previous php.general (#68470) next »