php如何去除字符串中的注释

lewis 2019-03-22 25次阅读

在php中使用strip_tags()函数去除字符串中的注释,具体方法如下:

strip_tags()函数作用:

php中strip_tags()函数的作用是用于剥除字符串中HTML、XML和PHP的标签与注释。

strip_tags()函数语法:

strip_tags(string,allow)

参数:

string:指定字符串。

allow:需要保留的注释或标签。

strip_tags()函数使用方法:

echo strip_tags("Hello world!","");

>>>Hello world!



发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。