PHP Code Function to Remove All Sorts of Spaces

PHP Code Function to Remove All Sorts of Spaces, Trim, Remove Spaces, Remove Multiple Spaces

Home Short:

This particular solution to deal with spaces and multiple spaces may be overkill depending upon your needs.

A simpler php regex function to deal with spaces and double spaces ...

Remove all spaces.

Replace multiple spaces with a single space.

S
H
A
R
E