PHP function Strip_tags provides the ability to remove HTML and PHP tags from a string, which attempts to return the result of the given string str after removing null characters, HTML, and PHP tags.
Because Strip_tags () cannot actually validate HTML, incomplete or broken labels will result in more data being deleted.
For example, the following code:
Copy the Code code as follows:
Stringstring <> hellostring
Filtering by Strip_tags ($str, '), we may expect to get the following result:
Copy the Code code as follows:
Stringstring<>
The actual operation results are as follows:
Copy the Code code as follows:
Stringstring
It's all because of the left angle bracket of accents, checked the PHP documentation, there is a warning prompt:
Because Strip_tags () cannot actually validate HTML, incomplete or broken labels will result in more data being deleted.
Since the code correctness cannot be verified before the filter is executed, the code that follows the character "<" or ">" that is associated with the tag is all hung up!
http://www.bkjia.com/PHPjc/774996.html www.bkjia.com true http://www.bkjia.com/PHPjc/774996.html techarticle PHP function Strip_tags provides the ability to remove HTML and PHP tags from a string, which attempts to return the result of the given string str after removing null characters, HTML, and PHP tags. ...