Im trying to get a string from a mysql database and handle it like an xml object, navigation etc.
i got an sql table with a “longtext” field wich stores my xml file as a simple string. I do the select on the database and i get the string but only the info, not the tags etc.
Is there any way to select a string from a mysql database (xml formated), get it to php and work with it as a xml file ?
thanks in advance
Retrieve the string from the database then load it into SimpleXML:
From there you can manipulate the xml object with the SimpleXML libray.
If you are retrieving the string and echoing it to a browser, and you only see the content of the tags (with no
<>) then that is because the browser is interpreting them as HTML tags. If you use the browsers view->source you’ll see the plain XML as a string.