I have this code
{foreach from=$last_user item=s}
<span class="sp_1">{$s.username}</span>
{/foreach}
I want only show three first letter of {$.username}
.
If i need JavaScript or jQuery please write full code.
I have this code
{foreach from=$last_user item=s}
<span class="sp_1">{$s.username}</span>
{/foreach}
I want only show three first letter of {$.username}
.
If i need JavaScript or jQuery please write full code.
you just have to use substring(startingFromIndex, endingIndex)
{foreach from=$last_user item=s}
<span class="sp_1">{$s.username.substring(0, 3)}</span>
{/foreach}
Here is a reference for a similar question