联系官方销售客服
1835022288
028-61286886
html过滤描述内容保留换行和原来的样式怎么办?
function dr_clearhtml($str) { $str = str_replace( array(' ', '&', '"', ''', '“', '”', '—', '<', '>', '·', '…'), array(' ', '&', '"', "'", '“', '”', '—', '<', '>', '·', '…'), $str ); $str = preg_replace("/\<[a-z]+(.*)\>/iU", "", $str); $str = preg_replace("/\<\/[a-z]+\>/iU", "", $str); $str = str_replace(array(PHP_EOL, chr(13), chr(10), ' '), '', $str); $str = strip_tags($str); return trim($str); } }
这个代码怎么改保留换行和原来的样式