$field->length()

Returns the length of the field content

  • return (integer)

Example

<?= $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>

Is something missing or incorrect? Edit this page on Github…