I am using php 7.1.8 and I am trying to use $output .= preg_replace('/\s+/', ' ', $output); to replace all spaces in a text that occur more than 1 time.
However, I get the following warning:
Warning: preg_replace(): No ending delimiter '+' found in C:\Users\admin\Desktop\Coding Projects\project\test.php on line 144
I only want to replace spaces. Is there a better way to do this?
I appreciate your replies!