/* 去掉文章内容中的html页面标签 */ $user_article_list = ‘’;//获取数据库中的内容数组 foreach ($user_article_list as $key => $value) { $value['article_content'] = str_replace(" ","",$value['article_content']);//去掉空格 $value['article_content'] = strip_tags($value['article_content']);//函数剥去字符串中的 HTML、XML 以及 PHP 的标签,获取纯文本内容 $user_article_list[$key]['article_content'] = $value['article_content']; } $this->assign('user_article_list',$user_article_list?$user_article_list:0);
tp5中去掉用户使用文本编辑器上传内容中的html标签元素
猜你喜欢
转载自blog.csdn.net/weixin_40047834/article/details/79988778
今日推荐
周排行