SproutCMS

This is the code documentation for the SproutCMS project

function limitChars()

Limits a plain-text phrase to a given number of characters.

Usage

string Text::limitChars ( string $str [, int $limit [, string $end_char [, boolean $preserve_words ]]] );

Arguments

  1. string $str
    Phrase to limit characters of, in plain text
  2. int $limit = 100
    Number of characters to limit to
  3. string $end_char = NULL
    Characters to append if text is limited, e.g. '...'
  4. boolean $preserve_words = FALSE
    True if whole words should be preserved; false to allow ending on a partial word

Return value

  • string
    Plain text