Re: [PHP] replacing multiple spaces with one

2002-07-15 Thread Jason Wong
On Tuesday 16 July 2002 00:15, David Russell wrote: > Hi all > > (easy one - I think) > > I need to replace all instances of multiple spaces in a string with a > single space. > > I tries the following: >$ArticleText = str_replace(' ', ' ', $ArticleText); > but if I have four spaces, I am lef

Re: [PHP] replacing multiple spaces with one

2002-07-15 Thread nico_free
Hellorgh !! $ArticleText = ereg_replace("[[:space:]].*", " ", $ArticleText); Should be fine... But AFAIK, using preg_replace should be faster, but I don't know the exact syntax to solve your probem :-( -- Nayco - Original Message - From: David Russell <[EMAIL PROTECTED]> To: php-general