You are here: Re: beginning of a string « PHP Language « IT news, forums, messages
Re: beginning of a string

Posted by Marcel on 11/28/05 15:55

"Brian" <not@given.com> schreef in bericht
news:wODif.4411$uR.2961@newsfe7-gui.ntli.net...
> Hi
>
> I should know this but never had to do it, I'm trying
> to work out what the beginning of a string contains
> What I'm trying to do is this
>
> $s = 'K123456'
>
> if the beginning of a string is 'K' then do X if
> beginning of a string is 'T' then do Y
> and so on
>


if($s{0} == 'K') {
// do something
}
if($s{0} == 'T') {
// do something else
}

 

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

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