Re: How do I evaluate this?

From: Date: Fri, 15 Mar 2002 17:25:38 +0000
Subject: Re: How do I evaluate this?
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3086@lists.php.net to get a copy of this message
Get rid of the nested brackets. {if $myvar|truncate:2 eq "--"}2{else}-1{/if} "Jan H. Andersen" wrote: > > I need to do something like this: > > {if {$myvar|truncate:2} eq "--"}2{else}-1{/if} > > As far as I know, I cant write it like this in Smarty. When $myvar contains > "--" as the first 2 characters I want to print "2" else "1". > > How can I make such an evaluation? > > Best Regards > > Jan H. Andersen > > --- > You are currently subscribed to smarty as: monte@ispi.net > To unsubscribe send a blank email to $subst('Email.Unsub') > Visit Smarty's homepage at 9†ÑÔd¼¨:›\×É+ > http://www.phpinsider.com/php/code/Smarty/ -- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.

« previous php.smarty.general (#3086) next »