count_characters

1.0 1.1 1.2 1.3

Counts the characters in a string

<?php
count_characters(string $value, [ bool $count_spaces = false ])
  • value: the string to process
  • count_spaces: if true, the white-space characters are counted as well

Examples

Example #1

index.tpl
{count_characters('ab cd')}
{count_characters('ab cd', true)}

The above example will output:

4
5