//html富文本提取text普通文本内容
private function getPlainTextFromHtml($html, $num = 'ALL')
{
// Remove the HTML tags
$html = strip_tags($html);
// Convert HTML entities to single characters
$html = html_entity_decode($html, ENT_QUOTES, 'UTF-8');
$html_len = mb_strlen($html, 'UTF-8');
// Make the string the desired number of characters
// Note that substr is not good as it counts by bytes and not characters
if ($num == 'ALL') {
$n = strlen($html);
} else {
$n = $num;
}
$html = mb_substr($html, 0, $n, 'UTF-8');
return $html;
}