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.
The other part in there replaces multiple hyphens with a single one.
$name = preg_replace('#[ -]+#', '-', $rawName);