PHP 将从数据库中读出的带有html标签的字符串,让标签起效,显示在前台页面

PHP htmlspecialchars_decode() 函数

把预定义的 HTML 实体 "<"(小于)和 ">"(大于)转换为字符:

   stripslashes()

 

html_entity_decode() 函数把 HTML 实体转换为字符。

$v['text'] = strip_tags(str_replace(" ","",htmlspecialchars_decode($v['text'])));

 转自https://bbs.csdn.net/topics/392571467   作者:debby004

原文地址:https://www.cnblogs.com/buxin111/p/11680255.html