Php string function strip_tags () usage summary

Source: Internet
Author: User
Tags string tags
The phpstrip_tags () function is a string function that removes HTML, XML, and PHP tags from strings. Then return the string after the tag is removed. This article collects several articles about the phpstrip_tags () function, hoping to help you understand the strip_tags () function. The php strip_tags () function is a string function that removes HTML, XML, and PHP tags from strings. Then return the string after the tag is removed. This article collects several articles about the php strip_tags () function, hoping to help you understand the strip_tags () function.

1. explain the strip_tags () function example for removing string tags from php

Many new friends may encounter some minor problems when learning php, such as how to remove tags from strings and character string garbled characters. In fact, these problems are very simple, the general garbled problem is that character encoding is not properly configured. you only need to set the character encoding. Basically, there will be no garbled problem, for specific articles, refer to the summary of php Chinese garbled problem solutions. how can I remove the string tag? In fact, it is very easy to remove the string tag. you only need to use the strip_tags () function to solve the problem. how to use this function is described in this article. php strip_tags () function.

2. notes for using the php strip_tags () function

The php strip_tags () function removes HTML, XML, and PHP tags from strings and returns the strings after the tags are removed. However, you need to pay attention to the details when using the php strip_tags () function, when the php strip_tags () function is used, if the HTML tag is incomplete or damaged, more data will be deleted. This article will introduce the consequences of using the strip_tags () function to remove incomplete HTML tags. Let's take a look.

3. use the php strip_tags () function to keep multiple HTML tag instances

The php strip_tags () function removes HTML, XML, and PHP tags from strings and returns the strings after the tags are removed. However, when we need to retain multiple HTML tags, how can I use the php strip_tags () function? This article introduces how to retain multiple HTML tags using the php strip_tags () function. let's take a look. Use the php strip_tags () function to retain multiple HTML tags. This mainly involves the second parameter of strip_tags. you can use the second parameter to set the tags that do not need to be deleted.

4. Brief introduction to htmlspecialchars, strip_tags, and addslashes functions in php

In web application development, htmlspecialchars, strip_tags, and addslashes functions are the most common functions. This article will introduce these functions separately.Strip_tags () functionRemoves HTML, XML, and PHP tags from strings.Htmlspecialchars () functionConverts a predefined character to an HTML object.Functions: stripslashes and addslashesThis is a pair. addslashes uses a backslash to reference the string, and stripslashes is to restore the string referenced by addslashes.

[Strip_tags () function related Q &]

How to filter html code converted from php-strip_tags

A problem occurs in substr and Json_encode after php-strip_tags is complete.

[Strip_tags () function entry]

Strip_tags

[Recommended related articles]

Differences between php htmlspecialchars () and strip_tags functions

In smarty, use strip_tags to filter html tags and truncate to capture articles

The above is a summary of the usage of the php string function strip_tags (). For more information, see other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.