You are here: Re: How to detect if there is more then one capital letter in a word « PHP Programming Language « IT news, forums, messages
Re: How to detect if there is more then one capital letter in a word

Posted by gosha bine on 09/14/07 11:44

On 14.09.2007 13:10 Moham12345 wrote:
> On 14 Sep, 12:03, Moham12345 <m_w_r...@hotmail.com> wrote:
>> How can i detect if there is more then capital letter in a word?
>
> sorry i think i did a typo just above... i was meant to say...
>
> How can i detect more then one capital letter in a word?
>


many possibilities, for example

preg_match_all('/[A-Z]/', $str, $m);
$num_up = count($m[0]);

or

$num_up = strlen($str) - strlen(preg_replace('/[A-Z]/', '', $str));

or

$num_up = levenshtein($str, strtolower($str));


where $str is your string and $num_up is a number of uppercase letters
in it.




--
gosha bine

makrell ~ http://www.tagarga.com/blok/makrell
php done right ;) http://code.google.com/p/pihipi

 

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

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