1. Addslashes ()Addslashes () escapes special characters in SQL statements, including ('), ("), (), (NUL) four characters, which are used when the DBMS does not have its own escape function, but if the DBMS has its own escape function, it is
Remove unnecessary HTML tags from php
Echo strip_tags ($ str );
2. retain onlyFor a tag, you only needThe string is written to the second parameter of strip_tags.
Echo strip_tags ($ str ,"");
3.
Explanation of native functions for php to remove html tags, and explanation of php tag functions. Php native functions for removing html tags; php tag functions for strip_tags for removing HTML and PHP tags. Syntax: stringstrip_tags (stringstr);
Name of function
Use
Note
Htmlspecialchars
will be with &&, single and double quotes ' ",Greater than >, less than
&&->&'->& #039"->"<>->>
Htmlentities
Turn all characters into HTML
Thank you for your answers! A few days ago, I had a strong interest in creating a website. Are these things on the title a complete set of knowledge required to build a website? Are there other things to learn? How to arrange the learning sequence?
Strip_tags get rid of HTML and PHP tags. 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 the HTML of
This article mainly introduces the native function of php to remove html tags. for details, refer to strip_tags to remove HTML and PHP tags. Syntax: string strip_tags (string str); return value: string function type: data processing content
This article mainly introduces the native function of php to remove html tags. for details, refer to strip_tags to remove HTML and PHP tags. Syntax: string strip_tags (string str); return value: string function type: data processing content
: This article mainly introduces PHP escape characters. if you are interested in the PHP Tutorial, refer to it. In many cases, escape errors may occur when you capture some text from a third party. Summarize some php built-in escape functions, as
For more information about the submitted content escaping, please refer to the following link: Generally, when writing a PHP program, do you need to execute escaping before the textarea data is submitted to the database? because if there is php code
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.