Re: unique array problem
| From: | Rafael | Date: | Sat, 22 Apr 2006 13:58:02 +0000 |
| Subject: | Re: unique array problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-234559@lists.php.net to get a copy of this message | ||
If what you want is to have a continuos secuential array (i.e. 0=>x, 1=>a, 2=>f) and there's no need for sorting the values, then you need array_values()[1]
[1] http://php.net/array-values
suresh kumar wrote:
I am facing one project in my project . this is my code: a=array(0=>10,1=>10,2=>20,3=>30,4=>30,5=>40); b=array(); b=array_unique($a); print_r($b); o/p getting from above code is b[0]=10,b[2]=20,b[3]=30,b[5]=40; but i want the o/p be b[0]=10,b[1]=20,b[2]=30,b[3]=40; i searched php.net .i am not able to fine any solution.i am breaking my head for last 5 hours.i am waiting reply from any one -- Atentamente, J. Rafael Salazar Magaña Innox - Innovación Inteligente Tel: +52 (33) 3615 5348 ext. 205 / 01 800 2-SOFTWARE http://www.innox.com.mx