Here's an off-the-wall idea... (TMTOWTDI)
explode the string into an array, then step through the array comparing the current element to the next one. If you get a dupe, just unset that array element. Then implode the array back into a string.
granted, its ugly, but workable. 😉