You are here: Re: what is the preg for capitals in a word to be replaced by that word preceded by a space « PHP Programming Language « IT news, forums, messages
Re: what is the preg for capitals in a word to be replaced by that word preceded by a space

Posted by zorro on 01/11/07 21:55

Toby Inkster wrote:
> echo preg_replace('/(.)([A-Z])/', "$1 $2", $string);

This won't always work either, although I haven't tested it.
If (.) can be any character then " Word" will be replaced by " Word"
(2 spaces).

Maybe this:
preg_replace('/(\w)([A-Z])/', "$1 $2", $string);

 

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

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