"Kaspa" <ka********@hotmail.com> wrote in message
news:e6*************************@posting.google.co m...
Hi,
How could I simulate the VB function Left() or Right() I would like to
return the first (x) characters of a string.
Thanks,
Kasparov
VB: strVar = left(strExt,12)
PHP: $strVar = substr($strExp,0,12);
VB: strVar = right(strExt,12)
PHP: $strVar = substr($strExp,-12);
or
PHP: $strVar = substr($strExp,(-1) * 12);
VB: strVar = mid(strExt,12) ' returns from chr 12 on to end of string
PHP: $strVar = substr($strExp,12);
VB: strVar = mid(strExt,12,5) ' returns from chr 12 , to 5 chrs
PHP: $strVar = substr($strExp,12,5);
Hope that helps
--
Mike Bradley
http://www.gzentools.com -- free online php tools