I am looking for the fastest way to remove duplicate values in a string separated by commas.
So my string looks like this;
$str = \'one,two,one,five,
The shortest code would be:
$str = implode(',',array_unique(explode(',', $str)));
If it is the fastest... I don't know, it is probably faster then looping explicitly.
Reference: implode, array_unique, explode