Converts HTML to formatted plain text
| package |
Framework |
|---|---|
| subpackage |
Utils |
__construct(string $source = '', boolean $from_file = false, boolean $do_links = true, integer $width = 75, $charset = 'UTF-8')
If the HTML source string (or file) is supplied, the class will instantiate with that source propagated, all that has to be done it to call get_text().
stringHTML content
booleanIndicates $source is a file to pull content from
booleanIndicate whether a table of link URLs is desired
integerMaximum width of the formatted text, 0 for no limit
_build_link_list(string $link, string $display)
Maintains an internal list of links to be displayed at the end of the text, with numeric indices to the original point in the text they appeared. Also makes an effort at identifying and handling absolute and relative links.
stringURL of the link
stringPart of the text to associate number with
_convert()
_convert_blockquotes( &$text)
_convert_pre( &$text)
_converter( &$text)
First performs custom tag replacement specified by $search and $replace arrays. Then strips any remaining HTML tags, reduces whitespace and newlines to a readable format, and word wraps the text to $width characters.
_strtoupper(string $str) : string
stringText to convert
stringConverted text
_toupper(string $str) : string
stringText to convert
stringConverted text
blockquote_citation_callback( $m)
get_text() : string
stringPlain text
pre_preg_callback(array $matches) : string
arrayPREG matches
string
print_text()
set_base_url( $url = '')
set_html(string $source, boolean $from_file = false)
stringHTML content
booleanIndicates $source is a file to pull content from
html : string
| var |
|---|
string
text : string
| var |
|---|
string
width : integer
Set this value to 0 (or less) to ignore word wrapping and not constrain text to a fixed-width column.
| var |
|---|
integer
charset : string
| var |
|---|
string
search : array
| var | |
|---|---|
| see |
array
replace : array
| var | |
|---|---|
| see |
array
ent_search : array
| var | |
|---|---|
| see |
array
ent_replace : array
| var | |
|---|---|
| see |
array
callback_search : array
| var |
|---|
array
pre_search : array
| var | |
|---|---|
| see |
array
pre_replace : array
| var | |
|---|---|
| see |
array
url : string
| var |
|---|
string
_converted : boolean
| var | |
|---|---|
| see |
$text |
boolean
_link_list : array
| var | |
|---|---|
| see |
array
_do_links : boolean
| var | |
|---|---|
| see |
boolean