title: removing duplicate characters next to each other
body: <p>im trying to remove duplicate characters that are directly next to each other</p>
  
  <p>1,2,3,4,5 - has a few commas but they are not to be removed
  1,,2,,3,,4,,5 - would have to be turned into the regular 1,2,3,4,5 no matter how many commas are inbetween each number i would like to have just one. i have something similar which makes sure there are no commas at the end of the string:</p>
  
  <pre><code>$n = "1,2,3,4,5";
  for ($i=0;$i&lt; strlen($n);$i++) {
  
      if (substr($n, -1) == ',') {
          $n = substr($n, 0, -1);
      }
  }
  </code></pre>
  
  <p>would appreciate some help on this matter,</p>
  
  <p>Thanks :)</p>