$html
$html :
Contains the HTML content to convert.
Converts HTML to formatted plain text
__construct(string $source = '', boolean $from_file = false, array $options = array())
Constructor.
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().
string | $source | HTML content |
boolean | $from_file | Indicates $source is a file to pull content from |
array | $options | Set configuration options |
_converter(string $text)
Workhorse function that does actual conversion.
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 $this->_options['width'] characters.
string | $text | Reference to HTML content string |
_build_link_list(string $link, string $display, null $link_override = null) : string
Helper function called by preg_replace() on link replacement.
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.
string | $link | URL of the link |
string | $display | Part of the text to associate number with |
null | $link_override |