In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
In this article Xiaobian for you to introduce in detail "what are the differences between htmlentities and htmlspecialchars in PHP", the content is detailed, the steps are clear, and the details are handled properly. I hope that this article "what are the differences between htmlentities and htmlspecialchars in PHP" can help you solve your doubts.
Both htmlentities and htmlspecialchars are used to convert special characters of a string into HTML character entities. There are only five special character sets escaped by htmlspecialcharsl.
'&' (ampersand) = >'&'
'' (double quote) = > 'when ENT_NOQUOTES is not set.
'' (single quote) = >'& # 039 'only when ENT_QUOTES is set.
''
The special character set escaped by htmlentities is the complete set of HTML character entities.
These two functions are explained in English in the php manual, and there is an English paragraph in the description of the htmlentities function:
This function is identical (identical) to htmlspecialchars () in all ways, except with htmlentities (), all characters which have HTML character entity equivalents (HTML)
Character entity equivalents is translated into HTML character entity equivalent) are translated into these entities.
From this sentence, we can also see that although the basic functions of the two functions are similar, there are still slight differences in them. Take a closer look at a passage in the htmlspecialchars function:
Certain characters (actually'&', double quotation marks (escaped only if ENT_NOQUOTES is not set), single quotation marks (escaped only if and only if ENT_QUOTES is set),') have special significance in HTML, and should be represented by HTML entities if they are to preserve their meanings. This function
Returns a string with some of these conversions made; the translations made are those most useful for everyday web programming. If you require all HTML character entities to be translated, use htmlentities () instead.
Note: the encoding format is finally specified when using these two functions.
After reading this, the article "what is the difference between htmlentities and htmlspecialchars in PHP" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it to understand it. If you want to know more about related articles, welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.