* * This version from https://github.com/mtibben/html2text * * * * This script is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * The GNU General Public License can be found at * * http://www.gnu.org/copyleft/gpl.html. * * * * This script is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * *************************************************************************/ class html2text { /** * Contains the HTML content to convert. * * @var string $html * @access public */ public $html; /** * Contains the converted, formatted text. * * @var string $text * @access public */ public $text; /** * Maximum width of the formatted text, in columns. * * Set this value to 0 (or less) to ignore word wrapping * and not constrain text to a fixed-width column. * * @var integer $width * @access public */ public $width = 70; /** * List of preg* regular expression patterns to search for, * used in conjunction with $replace. * * @var array $search * @access public * @see $replace */ public $search = array( "/\r/", // Non-legal carriage return "/[\n\t]+/", // Newlines and tabs '/]*>.*?<\/head>/i', // '/]*>.*?<\/script>/i', //