Here's my string seperated by commas (,)
$myStr = "One, Two,Three, Four , Five ,Six "
I am able successfully explode it {assign var="options" value=","|explode:$myStr}
But I also would like to remove whitespace at the beginning or end from each string when outputting it. In other words: I am looking for a SMARTY function equivalent to PHP's built-in trim($mystr)
function. PHP trim will remove the start and end white-spaces if it present, otherwise return the actual string.
{section name=myname loop=$options}
{$options[myname]}
{/section}
The code above would output:
One Two Three [whitespace]Four[whitespace] [whitespace]Five[whitespace] Six[whitespace]
How can I trim whitespaces?