Forum Moderators: coopster
$array = array(0=>'a', 1=>'b', 2=>'b', 3=>'c');
$array = array_unique($array);
// $array now = array(0=>'a', 1=>'b', 3=>'c')
// count($array) = 3
for($i = 0; $i < count($array); $i++)
{
// can't fully iterate through loop because $i doesn't correspond to keys, some of which no longer exist
}
Thought re-setting keys would be a simple function, but I don't see it in the manual.
$unique_array = array();
$unique_array = [url=http://www.php.net/array-values]array_values[/url](array_unique($array));