File/functions/text_functions.php

Description

CodeIgniter

An open source application development framework for PHP 4.3.2 or newer

Functions
ascii_to_entities (line 111)

High ASCII to Entities

Converts High ascii text and MS Word special characters to character entities

  • access: public
string ascii_to_entities (string $str)
  • string $str
character_limiter (line 73)

Character Limiter

Limits the string based on the character count. Preserves complete words so the character count may not be exactly as specified.

  • access: public
string character_limiter (string $str, [integer $n = 500], [string $end_char = '…'])
  • string $str
  • integer $n
  • string $end_char: the end character. Usually an ellipsis
entities_to_ascii (line 162)

Entities to ASCII

Converts character entities back to ASCII

  • access: public
string entities_to_ascii (string $str, [bool $all = TRUE])
  • string $str
  • bool $all
highlight_code (line 256)

Code Highlighter

Colorizes code strings

  • access: public
string highlight_code (string $str)
  • string $str: the text string
highlight_phrase (line 313)

Phrase Highlighter

Highlights a phrase within a text string

  • access: public
string highlight_phrase (string $str, string $phrase, [string $tag_open = '<strong>'], [string $tag_close = '</strong>'])
  • string $str: the text string
  • string $phrase: the phrase you'd like to highlight
  • string $tag_open: the openging tag to precede the phrase with
  • string $tag_close: the closing tag to end the phrase with
wordwrap_utf8 (line 448)

Word Wrap UTF8

Esta funcion es identica a la funcion PHP wordwrap pero permite hacer. los cortes en UTF8.

El parametro $cCorte es la cadena de corte que se pone al final de cada linea. El parametro $nCorte indica si se debe forzar el corte de linea aun cuando quede una cadena cortada por la mitad.

  • access: public
string wordwrap_utf8 (string $cCadena, int $nLongitud, [string $cCorte = '<br />'], [int $nCorte = 1])
  • string $cCadena
  • int $nLongitud
  • string $cCorte
  • int $nCorte
word_censor (line 220)

Word Censoring Function

Supply a string and an array of disallowed words and any matched words will be converted to #### or to the replacement word you've submitted.

  • access: public
string word_censor (string $str, string $censored, [string $replacement = ''])
  • string $str: the text string
  • string $censored: the array of censoered words
  • string $replacement: the optional replacement value
word_limiter (line 40)

Word Limiter

Limits a string to X number of words.

  • access: public
string word_limiter (string $str, [integer $limit = 100], [string $end_char = '…'])
  • string $str
  • integer $limit
  • string $end_char: the end character. Usually an ellipsis
word_wrap (line 344)

Word Wrap

Wraps text at the specified character. Maintains the integrity of words. Anything placed between {unwrap}{/unwrap} will not be word wrapped, nor will URLs.

  • access: public
string word_wrap (string $str, [integer $charlim = '76'])
  • string $str: the text string
  • integer $charlim: the number of characters to wrap at

Documentation generated on Tue, 22 Nov 2011 13:29:00 -0200 by phpDocumentor 1.4.3