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