Home > Backend Development > PHP Tutorial > PHP 过滤HTML和图片

PHP 过滤HTML和图片

WBOY
Release: 2016-06-23 14:13:20
Original
3887 people have browsed it

HTML PHP

echo $txt;
?>

例如输出内容:

 您好,这里是测试内容、 

 

 PHP 过滤HTML和图片 




如以上,输出的是HTML代码。

我想过滤HTML和图片,只留下纯文本。

什么写?求大神。

回复讨论(解决方案)

echo striptags($txt);

echo striptags($txt);

大哥,别吓我呀、、、

是:strip_tags 吧




但是里边的空格没有被过滤,什么整?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template