Posted by Shelly on 09/26/39 11:40
"Jim Carlock" <anonymous@127.0.0.1> wrote in message
news:IR8Kf.32687$Fw6.15304@tornado.tampabay.rr.com...
> Does PHP provide a function to extract the rightmost characters
> from a string?
>
> For example, the VB/ASP equivalent...
>
> sStateAbbr = Right$(sCityState, 2)
>
> Thanks.
>
> Jim Carlock
> Post replies to the group.
>
>
I think there is a function, but offhand can't recall it and a quick search
of www.php.net didn't reveal it quickly. However, there is always:
$sStateAbbr = substr($sCityState, strlen($sCityState) - 2);
Remember that PHP variables start with a dollar sign.
Shelly
[Back to original message]
|