View Single Post
  #1  
Old 12-02-2007, 09:46 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default smarty help please? can I compare the first x characters of a variable?

Smarty help, please?

I am seeking to compare the first x characters of a var string - for example:

let's says there's a variable: $variablename

{if $variablename 1st 5 characetrs = 1ZAB1}
then show something
{else}
show something else.

Can this be done in smarty?

My goal is to trap the first 5 characters of a tracking number -- and if it looks like 1ZAB1, then it is clearly UPS, and I will show a UPS tracking link. ELSE it can only be USPS (and a different tracking link)

Any ideas?

Thanks.

Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote