|
Posted by Marcus Bointon on 10/30/05 14:04
On 29 Oct 2005, at 20:41, Richard Lynch wrote:
> It was probably replacing *TWO* spaces with one.
>
> If so, it should really be in a while loop, because there could be 3
> or more spaces in a row, and if the goal is only single-spaced
> words...
I can hardly think of a better application for a regex:
$text = preg_replace('/ */', ' ', $text);
Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcus@synchromedia.co.uk | http://www.synchromedia.co.uk
Navigation:
[Reply to this message]
|