Function to replace "&<char>;" characters with what they represent?

From: Robert Oschler (no_replies_at_fake_email_address.invalid)
Date: 11/29/03


Date: Sat, 29 Nov 2003 00:39:02 GMT

Is there a PHP function that will convert "&<char>;" type characters to the
character they represent?

For example:

&amp; to &
&gt; to >
&lt to >

etc.

If not, has anybody seen a function on any of the PHP script sites that does
this? The problem is I don't know what to search for. If I was dealing
with the escaped characters (%20%2C, etc.) I would look for "escape", but
the name for these ampersand/semi-colon bracketed characters is unknown to
me.

"Sometimes to ask a question you already need to know half the answer."

thx

--
Robert Oschler
http://www.dog-images.com -- Devoted to providing free info on the health,
nutrition, and training of dogs.


Relevant Pages

  • Re: search/replace detokenized text
    ... (it expects normal catcodes and escaped characters rather than ... My other thought for the replacing was to \scantokens the detokenized ... expanding to their replacements (and everything else catcode12). ...
    (comp.text.tex)
  • Re: Escaped characters from the command-line
    ... handle escaped characters. ... It's a shell one. ... possible, in your shell, to specify those special characters. ... I'm still looking for a more elegant way then the ...
    (comp.lang.ruby)
  • Postgres BYTEA problems
    ... 'y' ends up containing a string of characters. ... many of these characters should be escaped characters. ... Can I possibly get the BYTEA results back as one very long Long? ...
    (comp.lang.python)
  • Re: Update SET ?
    ... > Taking data from a form, and using UPDATE tablename SET ... > Certain characters cause an error when the update happens. ... The escaped characters are automatically converted into the single ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.db)
  • Re: Special characters in Config file
    ... For Example & must be converted to & ... Assuming the configuration file is encoded in an encoding which ... includes those characters you can just include the ...
    (microsoft.public.dotnet.languages.csharp)