Friday, September 2, 2011

Smarty split a String

$item ='FFFEREE-TGFFGGF-RERR'

This is the can used to split smarty variable.

{assign var="bar_at" value=$item|strpos:"-"}
 <li>{$item}</li>
 <li>{$item|substr:0:$bar_at}</li>
<li>{$item|substr:$bar_at+1}</li>

2 comments: