selecting 4 characters starting from right of string

From: Date: Thu, 17 Feb 2005 02:47:30 +0000
Subject: selecting 4 characters starting from right of string
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12246@lists.php.net to get a copy of this message
How can i get something like this inside of template for a variable in a section loop? ================= $str="alp.jpg"; $length=strlen($str); $suffix= substr($str,$length-3, $length); if ($suffix==".jpg"){ do this }else{ Do that } ================= i dont want to handle it in php, i want to be able to check it in my template... is it possible?

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