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
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
2 matches
Mail list logo