count_characters[character count]

count_characters(Count the number of characters in the variable)

##test.php:$smarty = new Smarty;
$smarty->assign('articleTitle', 'Cold Wave Linked to Temperatures.');
$smarty->display('test.html');


test.html:{$articleTitle}
{$articleTitle|count_characters}
{$articleTitle|count_characters:true} //Spaces are also counted


Output:Cold Wave Linked to Temperatures.
29
33

Continuing Learning
||
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!