Re: [PHP] distinct element from array

2002-01-06 Thread Kancha .
doesn't seem to work for multidimensional array. $yourarray looks like this in my case $yourarray[0] => array() $yourarray[1] => array() //i'm looking for distinct elemtns in the inner array --- Bogdan Stancescu <[EMAIL PROTECTED]> wrote: > $distincts=array(); > while (list($key,$val)=each($yo

Re: [PHP] distinct element from array

2002-01-06 Thread Andrey Hristov
Try array_unique() Regards, Andrey Hristov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

Re: [PHP] distinct element from array

2002-01-06 Thread Bogdan Stancescu
$distincts=array(); while (list($key,$val)=each($yourarray) { if (!in_array($val,$distincts)) { $distincts[]=$val; } } "Kancha ." wrote: > An array contains various values eg: list of fruits. > Now i want to retrieve only unique fruits from the > array. The array may contain duplicate

[PHP] distinct element from array

2002-01-06 Thread Kancha .
An array contains various values eg: list of fruits. Now i want to retrieve only unique fruits from the array. The array may contain duplicate names. How can i achieve this? __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo