What function can be used to remove duplicates from a string in PHP?

To remove duplicates from a string in PHP, you can use the `array_unique` function to remove duplicate values from an array, and then use `implode` to convert the unique array back into a string.

$string = "helloo";
$uniqueString = implode("", array_unique(str_split($string)));
echo $uniqueString;