public static function htmlToText($html, $eol = "\n") {
		// strip parts before body tag
		if (strpos($html, '<body>')){
			$html = substr($html, (strpos($html, '<body>')+6));
		}
		// remove all new lines
		$html = str_replace(array("\r\n", "\n", "\r"), '', $html);
		
		// convert br and p strip html tags
		$html = str_replace(array('<p>', '<div>', '<pre>', '<table>', '<ul>', '<ol>'), $eol . $eol, $html);
		$html = str_replace(array('<br />', '<br>', '<p>', '<ul>', '<li>'), $eol, $html);
		return strip_tags($html);
	}
public static function htmlToText($html, $eol = "\n") {
		// strip parts before body tag
		if (strpos($html, '<body>')){
			$html = substr($html, (strpos($html, '<body>')+6));
		}
		// remove all new lines
		$html = str_replace(array("\r\n", "\n", "\r"), '', $html);
		
		// convert br and p strip html tags
		$html = str_replace(array('<p>', '<div>', '<pre>', '<table>', '<ul>', '<ol>'), $eol . $eol, $html);
		$html = str_replace(array('<br />', '<br>', '<p>', '<ul>', '<li>'), $eol, $html);
		return strip_tags($html);
	}
public static function htmlToText ( $ html , $ eol = "\n" ) { // strip parts before body tag
 if ( strpos ( $ html , '<body>' ) ) { $ html = substr ( $ html , ( strpos ( $ html , '<body>' ) + 6 ) ) ; } // remove all new lines
 $ html = str_replace ( array ( "\r\n" , "\n" , "\r" ) , '' , $ html ) ; // convert br and p strip html tags
 $ html = str_replace ( array ( '<p>' , '<div>' , '<pre>' , '<table>' , '<ul>' , '<ol>' ) , $ eol . $ eol , $ html ) ; $ html = str_replace ( array ( '<br />' , '<br>' , '<p>' , '<ul>' , '<li>' ) , $ eol , $ html ) ; return strip_tags ( $ html ) ; }
converts html into text
@param string $html
@param string $eol
converts html into text