php function to remove double words from string code example Example: php remove duplicates from string $str = implode(',',array_unique(explode(',', $str)));