We are actually operatingThe sample code for the PHP delete array repeating element is as follows:
-
- function Uniquearray ($array)
- {
- Get unique ELTs as keys in Assoc. Array
- For ($i=0, $n=count ($array, 1); $i<$n; $i + +)
- $u _array[$array [$i]] = 1;
-
- Copy keys only to another array
- Reset ($u _array, 1);
- For ($i=0, $n=count ($u _array, 1); $i<$n; $i + +) {
- $unduplicated _array[] = key ($u _array, 1);
- Next ($u _array, 1);
- }
- return $unduplicated _array;
- }
- ?>
The above code is the implementation of PHP to delete duplicate elements of the array.
http://www.bkjia.com/PHPjc/446339.html www.bkjia.com true http://www.bkjia.com/PHPjc/446339.html techarticle we are actually working with PHP to delete the array repeating elements sample code as follows:? function Uniquearray ($array) {//getuniqueeltsaskeysinassoc.array for ($ i = 0, $ n = coun T ($array, 1); $i $n ...