<?xml>
<table>
<row>
<columnA>ValueA</columnA>
<columnB>ValueB</columnB>
<columnC>ValueC</columnC>
<columnD>ValueD</columnD>
<columnE>ValueE</columnE>
</row>
<row>
<columnA>ValueA</columnA>
<columnB>ValueB</columnB>
<columnC>ValueC</columnC>
<columnD>ValueD</columnD>
<columnE>ValueE</columnE>
</row>
...
</table>
-
you can likely adapt the code shown hereGordon– Gordon2010-10-14 14:20:16 +00:00Commented Oct 14, 2010 at 14:20
Add a comment
|
3 Answers
Comments
You could either use...
htmlentities($table, ENT_QUOTES);
Or you could use CDATA...
<![CDATA[
<table>
<row>
<columnA>ValueA</columnA>
<columnB>ValueB</columnB>
<columnC>ValueC</columnC>
<columnD>ValueD</columnD>
<columnE>ValueE</columnE>
</row>
<row>
<columnA>ValueA</columnA>
<columnB>ValueB</columnB>
<columnC>ValueC</columnC>
<columnD>ValueD</columnD>
<columnE>ValueE</columnE>
</row>
...
</table>
]]>
2 Comments
CRISHK Corporation
I'm looking for a function like json_encode that converts an array to JSON format, but in this case to XML
Fenton
There isn't a built-in function for that, but there custom functions available... like this one... snipplr.com/view/3491/…
I prefer using MDB2-Schema PEAR class to store SQL table structure in XML files. http://pear.php.net/manual/en/package.database.mdb2-schema.dump.php