I'm looking for a regular expression that removes redundant (two or more) spaces but keeps line breaks.
Any idea how that would work?
Thanks in Advance!
I'm looking for a regular expression that removes redundant (two or more) spaces but keeps line breaks.
Any idea how that would work?
Thanks in Advance!
Remove spaces and tabs
preg_replace("/[ \t]+/", " ", $myval);
Remove only spaces
preg_replace("/[ ]+/", " ", $myval);