count_characters

Подсчитывает количество символов в переменной.

Позиция параметраТипОбязателенПо умолчаниюОписание
1booleanНетfalseОпределяет, учитывать ли пробелы при подсчете.

Пример 5-4. count_characters

<?php

$smarty
->assign('articleTitle''Cold Wave Linked to Temperatures.');

?>

Шаблон:

{$articleTitle}
{$articleTitle|count_characters}
{$articleTitle|count_characters:true}

Результат обработки:

Cold Wave Linked to Temperatures.
29
33

См. также count_words, count_sentences и count_paragraphs.