: This article mainly introduces the php string processing function (below). If you are interested in the PHP Tutorial, please refer to it. HTML tag-related string formatting
If a common post is used to receive webpage input information
";//echo stripslashes(addslashes($title))."
";//echo htmlspecialchars($title);}?>
This is my input
1234But I'm so scared. what if I transfer bad code to destroy your webpage?
At this time, the string format associated with our HTML tag is blank
stripslashes(addslashes($title))
Enter what is displayed, delete the escape character, and add the escape character ...... ()
Function: nl2br ()
Syntax: string nl2br (string) converts "\ n" in the string into an HTML linefeed"
"
Function: htmlspecialchars ()
Syntax: string htmlspecialchars (string [,
Int quote_style [, string charset]) converts a specified special symbol to an object, as shown in <>
'&': '"'
''': ''' <':' <'
'>': '>'
Function: htmlentities ()
Syntax: string htmlentities (string [, int quote_style [, string charset]) can convert all non-ASCII codes into corresponding entity codes.
Function: string strip_tags ()
Syntax: string strip_tags (string str [, string allowable_tags]) the parameter after the tag function for deleting HTML is the tag to be retained.
The above introduces the php string processing function (below), including the content, hope to be helpful to friends who are interested in the PHP Tutorial.