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]
|