I have string of comma separated values.
1,2,3,4,4,4,4,4,4,4,4,01633,4,4
I need to remove the duplicates, so I though of using
array_unique($str);
However, it returns no results. So I decided to output it to see what I have:
print_r($str);
// returns: 1,2,3,4,4,4,4,4,4,4,4,01633,4,4
I'm a little lost. I checked if it is an array and I got true. Here's how that string is created:
$str = '1,2,3';
foreach ($a as $b) {
$str.= ','.$b;
}
What am I missing here?