代码: 全选
/**
* 去掉html中的分段
*
* @access public
* @param string $html 输入串
* @return string
*/
public static function removeParagraph($html)
{
/** 锁定标签 */
$html = self::lockHTML($html);
$html = str_replace(array("\r", "\n"), '', $html);
$html = trim(preg_replace(
array("/\s*<p>(.*?)<\/p>\s*/is", "/\s*<br\s*\/>\s*/is",
"/\s*<(div|blockquote|pre|code|script|table|fieldset|ol|ul|dl|h[1-6])([^>]*)>/is",
"/<\/(div|blockquote|pre|code|script|table|fieldset|ol|ul|dl|h[1-6])>\s*/is", "/\s*<\!--more-->\s*/is"),
array("\n\\1\n", "\n", "\n\n<\\1\\2>", "</\\1>\n\n", "\n\n<!--more-->\n\n"),
$html));
return trim(self::releaseHTML($html));
}
这个该怎么解决?