You are here: Re: [PHP] [DONE] Substr by words « PHP « IT news, forums, messages
Re: [PHP] [DONE] Substr by words

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация