【发布时间】:2012-06-28 10:12:12
【问题描述】:
可能重复:
PHP function to strip tags, except a list of whitelisted tags and attributes
我有一个带有一些不需要的 html 标签的数据库,我需要保留一些 html 格式。我尝试使用 str_replace 删除不需要的标签,但它不起作用:
$newdrp = str_replace('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html>',"",$row_Recordset1['full_description']);
【问题讨论】:
-
您应该添加有关源文本外观的更多信息。
标签: php str-replace