strip_tags function usage and examples tutorial_PHP tutorial

WBOY
Release: 2016-07-20 11:00:30
Original
1098 people have browsed it

Definition and usage
The strip_tags() function removes all HTML, XML and PHP tags.

Grammar

strip_tags(string,allow)
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
		参数
Copy after login
说明
string 必需的。指定的字符串检查
allow 任择。指定允许的标签。这些标签不会被删除
illustrate
string Required. Specified string check
allow Optional. Specify allowed tags. These tags will not be deleted
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login

Tips and Instructions NOTE: Comments are always stripped of their HTML. This cannot be changed as an allowed parameter. Example 1

<!--?phpecho strip_tags("Hello <b-->world!");?>
Copy after login
结果为.
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Hello world!
Copy after login
 
Copy after login
Copy after login
再来看一个<strong>strip_tags</strong>函数的例子
Copy after login
 
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
<!--?phpecho strip_tags("Hello <b--><i>world!</i>","<b>");?></b>
Copy after login
<b> </b>
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
<b>Hello <strong>world!</strong></b>
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445526.htmlTechArticleDefinition and Usage The strip_tags() function removes all HTML, XML and PHP tags. Syntax strip_tags(string,allow) Parameter Description string Required. Specified string check...
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!