Re: Character Entity References



..oO(ft310)

We had a consultant write some PHP software for us which in most
respects is working, but we have one issue we are having trouble
comprehending.

If the following company name "Jones & Jones" were entered into this
software, it appears in our database as {Jones & Jones} (brackets
mine).

How do we characterize this and what is {&} called.

The value in the DB should be "Jones & Jones" and nothing else. The
escaping is taking place only when you output the name to an HTML page.

Actually the & is called a named character reference (entity). Some
characters like the ampersand '&' for example have a special meaning in
HTML, which is why you have to write them as character references if you
want to output them as a literal string.

But what's the problem or the question?

Micha
.



Relevant Pages

  • Re: Character Entity References
    ... If the following company name "Jones & Jones" were entered into this ... is called a named character reference. ... HTML, which is why you have to write them as character references if you ... It sounds like his problem is the consultant put the entity into the database instead of an ampersand. ...
    (comp.lang.php)
  • Re: How not to parse HTML??
    ... Karl R. B. Jones wrote: ... I am creating the HTML page dynamically, and don't know in advance what the string will be. ... I need to tell the parser to display it as it is without responding to any tags it may contain. ...
    (microsoft.public.inetsdk.html_authoring)