title: Replace multiple occurrences of same symbol using preg_replace?
body: <p>Let's say I have a string like this:</p>
  
  <pre><code>$string = "hello---world";
  </code></pre>
  
  <p>How would I go about replacing the --- with a single hyphen?
  The string could easily look like this instead:</p>
  
  <pre><code>$string = "hello--world----what-up";
  </code></pre>
  
  <p>The desired result should be:</p>
  
  <pre><code>$string = "hello-world-what-up";
  </code></pre>