Smarty getting substring of a var with strpos as start and strlen as end
问题 I am having issue formatting variables in smarty. I was wondering what is the best way to do it. Basically i have a string "ABC | DEFGH" i want smarty to get the substring of "DEFGH" How would i go about doing this? {$var|substr:strpos:"|":strlen} doesn't work 回答1: Just solved this without setting var back in PHP, and by using the built-in function wrappers. Assuming that: $var = "ABC|DEFGH"; {assign var="bar_at" value=$var|strpos:"|"} <li>{$var}</li> <li>{$var|substr:0:$bar_at}</li> <li>{