ok so i have an array which has duplicate values in it.
i used array_unique() to remove duplicate values.
the array had values 1,2,2,3.
after the following code:
$unique = array_unique($suggest);
$size = count($unique);
for ($x=0;$x<=$size;$x++)
{
echo $unique[$x];
echo "<br>";
}
it prints out 1,2 and then gives an error, "Notice: Undefined offset: 2 in E:\wamp\www\Copy of pro2\Classes.php on line 1074" and then finally 3.
any ideas how i can solve this.
im assuming that array_unique() assigns the index 0,1,3 of the duplicate value array to unique array at the same indexs 0,1,3. since the index 2 of duplicate array is a duplicate value it is ommited but the unique array does not have an array at index 2.