#native_company# #native_desc#
#native_cta#

clean up duplicated entries in array function

By Fernando Michelotti
on June 19, 2001

Version: 0.1

Type: Function

Category: Other

License: GNU General Public License

Description: clean up duplicated entries in array and reindex it. Its actually a really simple script but Ive had quite a few problems before I was able to write it.

<?php
function cleanupduplicates($array){
         $n = 0;
         $crap = array_values(array_unique($array));
         $cc = count($crap);
         for ($i = 0; $i < $cc; $i++) {
              if ($crap[$i] != ''){
              $img[$n] = $crap[$i];
              $n++;
              }
             }
    return $img;
}

?>