title: Php replace multiple spaces with single spaces
body: <p>How can I add something to replace all multiple spaces in a string, with only single spaces in the below regex?. Everything else in the below code needs to remain as it is. I'm only trying to add the replace multiple spaces part.</p>
  
  <p>The other part in there replaces multiple hyphens with a single one.</p>
  
  <pre><code>$name = preg_replace('#[ -]+#', '-', $rawName);
  </code></pre>