Re: remove spaces using php function
| From: | Evan Nemerson | Date: | Tue, 07 Oct 2003 09:25:11 +0000 |
| Subject: | Re: remove spaces using php function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165278@lists.php.net to get a copy of this message | ||
You mean something like
ereg_replace(' +', ' ', 'asked his friend..');
or perhaps
preg_replace('/ +/', ' ', 'asked his friend..');
?
Of course, if you're getting this data from a luser, those may not be spaces.
They could be obscure, non-printing characters. Take a look at bin2hex to
find out.
On Tuesday 07 October 2003 02:15 am, Uma Shankari T. wrote:
> Hello,
>
> Is there any function which will remove extra spaces between each
> words..??
> for example if the user typed
>
> asked his friend..
>
> is there any function to remove the extra space between his and asked
> except one space ??
>
> Regards,
> Uma
--
Evan Nemerson
evan@coeus-group.com
--
"Truth, like gold, is to be obtained not by its growth, but by washing away
from it all that is not gold. "
-Leo Nikolaevich Tolstoy