[thelist] Duplicates in php array

Burhan Khalid burhankhalid at members.evolt.org
Sun Dec 8 10:37:00 CST 2002


C> I have a php array that has several duplicate records in it.  I need to
C> create a new array
C> that will only hold unique entries from the first array.  Array's are not

PHP has a built in function for this, namely array_unique() that
returns an array with only the unique values in another array.

Basic syntax : array array_unique(array);

More info : http://www.php.net/manual/en/function.array-unique.php

hth
--
*---------------*
| Burhan Khalid |
*---------------*---------------------------*
| Email : burhankhalid[at]members.evolt.org |
| Web   : members.evolt.org/burhankhalid    |
*-------------------------------------------*






More information about the thelist mailing list