How do I evaluate this?

From: Date: Fri, 15 Mar 2002 17:18:51 +0000
Subject: How do I evaluate this?
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3085@lists.php.net to get a copy of this message
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

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