Re: Hot array problem: Strip off redundant elements

From: Date: Tue, 28 Nov 2000 11:54:04 +0000
Subject: Re: Hot array problem: Strip off redundant elements
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-27580@lists.php.net to get a copy of this message
Check the array_unique() function http://www.php.net/manual/function.array-unique.php ] You could also sort the array using any of the sorting functions and then something like: reset( $array ); while( list( $pos, $val ) = each( $array )) { if( $val == $last ) unset( $array[ $pos ] ); $last = $val; } ""Juergen Hall"" <jyrgen@gmx.de> wrote in message news:9003g2$k4a$1@toye.p.sourceforge.net... > hi, > i need a smart way to get rid of redundant elements > in an array, without doing too much loops. > thanks again > > jyrgen > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#27580) next »