Reg ex help-Removing extra blank spaces before HTML output
| From: | Ken | Date: | Wed, 05 Dec 2001 07:06:02 +0000 |
| Subject: | Reg ex help-Removing extra blank spaces before HTML output | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-76653@lists.php.net to get a copy of this message | ||
I want to remove all superfluous blank spaces before I sent my HTML output, to make the output
smaller.
So I'd like to take $input, replace any number of blank space or newlines that are consecutive
and replace them with a single blank.
I.e. I will list a blank space as b and a newline as n:
If input is: bbbbbTEXTHEREbbbnnnbnMOREbEVENMORE
Then output should be: bTEXTHEREbMOREbEVENMORE
I imagine this would be handled by a simple regular expression call, but I'm no pro with them
yet.
Any help?
Thanks,
Ken
kenzo@free-music.com