0

I have an XML file that contains elements with character codes. For example:

<LocItem LocName="Roat&#x00E1;n Island, Honduras" />

I am trying to use PHP's SimpleXML to parse this XML file and store the LocName to a MySQL database exactly as it is displayed in the XML file (with the character code).

How can this be achieved? Thanks.

kcristella
  • 315
  • 1
  • 3
  • 8
  • what so far you have tried ? – sas Jan 11 '14 at 15:02
  • I tried inserting to database as is which yields "Roatán Island, Honduras". Did some research on UTF-8 but I don't want anything converted so that wasn't much help. – kcristella Jan 11 '14 at 15:07
  • 1
    Afaik, there's no easy solution to this (see the answer linked by dev-null-dweller). What is the reason you _need_ this? I prefer to store my data as it is, not as it has to be for some interface (i.e. HTML, XML, json etc.). – Wrikken Jan 11 '14 at 15:20

0 Answers0