如何分析php strip_tags()函数在字符串过滤中的应用实例?
- 内容介绍
- 文章标签
- 相关推荐
本文共计552个文字,预计阅读时间需要3分钟。
本例介绍了PHP函数strip_tags()的使用方法。strip_tags()用于从字符串中去除HTML和PHP标签。
使用方法:strip_tags(string $str)
参数:- $str:要处理的字符串。
示例:phpHello, world!
;$clean_text=strip_tags($text);echo $clean_text; // 输出:Hello, world!?>本文实例讲述了php字符串过滤strip_tags()函数用法。分享给大家供大家参考,具体如下:
strip_tags — 从字符串中去除 HTML 和 PHP 标记,非常重要的函数
(PHP 4, PHP 5, PHP 7)
string strip_tags ( string $str [, string $allowable_tags ] )
$str:输入字符串。
$allowable_tags:可选,指定不被去除的字符列表。
作用:剥去字符串中的 HTML、XML 以及 PHP 的标签。
返回值:返回被剥离的字符串。
本文共计552个文字,预计阅读时间需要3分钟。
本例介绍了PHP函数strip_tags()的使用方法。strip_tags()用于从字符串中去除HTML和PHP标签。
使用方法:strip_tags(string $str)
参数:- $str:要处理的字符串。
示例:phpHello, world!
;$clean_text=strip_tags($text);echo $clean_text; // 输出:Hello, world!?>本文实例讲述了php字符串过滤strip_tags()函数用法。分享给大家供大家参考,具体如下:
strip_tags — 从字符串中去除 HTML 和 PHP 标记,非常重要的函数
(PHP 4, PHP 5, PHP 7)
string strip_tags ( string $str [, string $allowable_tags ] )
$str:输入字符串。
$allowable_tags:可选,指定不被去除的字符列表。
作用:剥去字符串中的 HTML、XML 以及 PHP 的标签。
返回值:返回被剥离的字符串。

