What is the deal with the named html object for $ (& dollar;)

I have a pretty simple question. To denote the dollar, there is a named html entity in the "majority" of links, and this is what you expect from it; '& Amp; dollar;'.

But in other links, this is missing, and you say that only a numerical object is available (& # 36;).

As I recall, the named object did not exist for a long time, because $ is part of the standard ascii set. And because of this, earlier / older versions of IE and other browsers do not support this object.

So what is connected with this? I am looking for what support for a named object and why it was not supported in the first place ...

Here is a link to all currency symbols, where, oddly enough, only the dollar does not have a named object http://www.entitycode.com/#currency-content

Here is a small example of what I'm talking about when you use dollar + int http://codepad.org/xCxWZWsu And yes, I know that in this simple example I could just escape from the dollar sign with a slash, but trust me when I say that creating its essence while storing a string is the most reasonable solution in my case.

Regardless of my example, I'm still wondering what support is for the dollar; an object.

+7
source share
2 answers

the official list of entities does not list it, so I would write it under "some browsers may have had support for it, do not rely on it."

As a rule, entities were necessary to represent non-ASCII characters when the character set of a document was limited to ASCII. Currently, with UTF-8, the most common character set on the Internet, I think we can finally move past named objects and just use the characters directly.

+4
source

The only reasonable solution is to use preg_quote () when using input for regular expressions. Otherwise, you need to use html-enities. \ + *? [^] $ () {} =! <> |: - too.

0
source

All Articles