Is there a Php Command or how do you replace multiple blank spaces in a string with just 1 blank space?
For example say the string is:
$string = "Rental Scooter Florida"
as you can see there are multiple blank spaces between Scooter and Florida.
So is there a function or code you can suggest that one would submit this string to and get:
$string = "Rental Scooter Florida"
with ONLY 1 blank space between each Word of the string.
The preg_replace() function does not pass its third argument by reference, so you will need to reassign the $str variable to the returned result of preg_replace():