I have a string like this:
'spain,france,spain,germany,france,spain'
need to have only unique substrings
'spain,france,germany'
the only way I could think of was this converting to an array and back:
$countries = "spain,france,spain,germany,france,spain";
$country = implode( ",", array_unique( explode( ",", $countries ) ) );
Another/correct way to do it?