Function: remove HTML and PHP tags. Syntax: stringstrip_tags (stringstr); return value: string
1. strip_tags
Function: remove HTML and PHP tags.
Syntax: string strip_tags (string str );
Return value: string
Note: This function removes any HTML and PHP tags contained in the string. If the HTML and PHP tags of a string are incorrect, for example, if a greater symbol is missing, an error is returned.
Note: If the extracted text content is displayed, this space cannot be replaced by the number of rows above. in this case, use str_replace to replace the content separately.
2. htmlspecialchars
Function: convert special characters to HTML format.
Syntax: string htmlspecialchars (string );
Return value: string
This function converts special characters into the string format of HTML (&....;). The most common use case may be the message board for handling customer messages.
& (And) to & "(double quotation marks) to" <(less than) to <> (greater than) to>
This function only converts the preceding special characters and does not convert all the characters to the ASCII conversion specified in HTML.