Re: [DONE] Substr by words

From: Date: Sun, 30 Oct 2005 12:04:28 +0000
Subject: Re: [DONE] Substr by words
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-224841@lists.php.net to get a copy of this message
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

« previous php.general (#224841) next »