Home > Article > Backend Development > PHP strip_tags() function to remove HTML, XML and PHP tags from strings
strip_tags definition and usage
strip_tags() function strips HTML, XML and PHP tags from strings.
Comments: This function always strips HTML comments. This cannot be changed via the allow parameter.
Note: This function is binary safe.
Syntax
strip_tags(string,allow)
Technical details
strip_tags Example 1,
Strip the HTML tags in the string:
world!"); ?>
Result
Hello world!,
Example 2
Strip the HTML tags in the string, but allow the tag:
world!",""); ?>
Result
Hello world!
For more PHP strip_tags() function to remove HTML, XML and PHP tags in strings, please pay attention to the PHP Chinese website for related articles!