title: remove duplicate from string in PHP
body: <p>I am looking for the fastest way to remove duplicate values in a string separated by commas.</p>
  
  <p>So my string looks like this;</p>
  
  <pre><code>$str = 'one,two,one,five,seven,bag,tea';
  </code></pre>
  
  <p>I can do it be exploding the string to values and then compare, but I think it will be slow. what about preg_replace() will it be faster? Any one did it using this function?</p>