$field->length()

Returns the length of the field content

  • return (integer)

Example

<?php echo $page->text()->kirbytext() ?>

<dl class="text-stats">

  <dt>Characters</dt>
  <dd><?php $page->text()->length() ?></dd>

  <dt>Words</dt>
  <dd><?php $page->text()->words() ?></dd>

</dl>