Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How does php remove the native function of html tags

Shulou Source: shulou.com Published: 2022-05-31 13:14:27 11月18日 Update

This article mainly introduces "php how to remove the native function of html tag". In daily operation, I believe that many people have doubts about how php removes the native function of html tag. Xiaobian consulted all kinds of data and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the question of "how to remove the native function of html tag by php". Next, please follow the editor to study!

Strip_tags removes the marks of HTML and PHP. Syntax: string strip_tags (string str); return value: string function type: data processing content description this function can remove any HTML and PHP tag strings contained in the string. If there are errors in the HTML and PHP tags of the string, for example, if the symbol greater than is missing, an error will also be returned.

Strip_tags

Remove the HTML and PHP marks.

Syntax: string strip_tags (string str)

Return value: string

Type of function: data processing

Content description

This function removes any HTML and PHP tag strings contained in the string. If there is an error in the HTML and PHP tags of the string, for example, if the symbol greater than is missing, an error will also be returned. This function has the same function as fgetss ().

Htmlspecialchars

Converts special characters to HTML format.

Syntax: string htmlspecialchars (string string)

Return value: string

Type of function: data processing

This function converts special characters to the string format of HTML (&.;). The most commonly used occasion is probably the message version for dealing with customer messages.

& (and) turn into &

"(double quotation marks) converted to"

< (小于) 转成 <   >

(greater than) convert to >

This function only converts the special characters above, and not all of them are converted to the ASCII transformation specified by HTML.

Use example

The copy code is as follows:

Tags: Tags special content functions data escape processing learning code data database time tags categories symbols grammars characters more formatting if Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei NVidia Redmi Shulou Technology Microsoft