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

Posted by Brian on 11/28/05 16:02

"Marcel" <sorryafraidofspam@nospam.com> wrote in message
news:d6b42$438b0bf2$d969db07$29182@cache30.multikabel.net...
>
> "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
> }
>
See i knew is was an easy answer and i should have known it
Thanks guys

 

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

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