I'm looking to replace multiple instances of space characters. My initial searches all seem to focus on using the /s
but this includes newlines and other whitespace
I think this should be close? replace two or more instances spaces " "
with one space
preg_replace('/ {2,}/', ' ', $string);