public static function convertToPlainText($html, $strip_urls = false, $html_format = false){

		$plain_text = $html;

		// Attempt to maintain some basic formatting

		$plain_text = str_replace('<li>', ' * ', $plain_text);
		$plain_text = str_replace(['</p>', '</h1>', '</h2>', '</h3>'],
			PHP_EOL . PHP_EOL, $plain_text);
		$plain_text = str_replace(['</ul>', '</ol>', '<br>', '</li>', '</h4>', '</h5>'],
			PHP_EOL, $plain_text);

		// Strip out all remaining HTML tags

		$plain_text = preg_replace('/<\/?.*>/iU', '', $plain_text);

		// Strip out everything that resembles a URL

		if($strip_urls){

			$pattern = '/(?:(?:https?\:\/\/(?:www\.)?)|(?:www\.))\S+\s?/i';
			$plain_text = preg_replace($pattern, '', $plain_text);
		}

		$plain_text = html_entity_decode($plain_text, ENT_QUOTES, DEFAULT_CHARSET);
		$plain_text = trim($plain_text);

		// Apply "HTML formatting" to the plain-text

		if($html_format){

			$plain_text = htmlentities($plain_text, ENT_QUOTES, DEFAULT_CHARSET);
			$plain_text = str_replace(PHP_EOL, '<br>', $plain_text);
			$plain_text = "<p>$plain_text</p>";
		}

		return $plain_text;
	}