Strip_tags
get rid of HTML and PHP tags.
Syntax: string strip_tags (String str);
return value: String
Types of functions: Data processing
Content Description
This function can remove any HTML and PHP tag strings contained in the string. If the HTML and PHP tags of the string are wrong, such as less than the symbol greater than, it will return the error. This function and FGETSS () have the same functionality.
Htmlspecialchars
converts a special character into HTML format.
Syntax: String htmlspecialchars (String string);
return value: String
Types of functions: Data processing
This function converts a special character into an HTML string format (&....;). The most commonly used occasions may be to deal with the message version of the customer message.
& (and) Convert to &
"(double quotes) into"
< (less than) turn into <
> (greater than) convert to >
"(single quotation mark) turn into '
This function converts only the special characters above, and does not convert all to the ASCII conversion specified by HTML.
Copy Code code as follows:
<?php
$new = Htmlspecialchars ("<a href= ' test ' >Test</a>", ent_quotes);
Echo $new;
?>
Result: <a href= ' test ' >Test</a>