Saturday, November 19, 2011

show data inside cdata section xml

To show data inside CDATA section in xml from PHP.

if you use this type of xml file

  <Data>
<row no="1">
<DL val="ID">474692000000048282</FL>
<DL val="Name">
<![CDATA[ Marion Center ASD ]]>
</DL>
</row>
<row no="2">
<DL val="ID">474692000000048280</FL>
<DL val="Name">
<![CDATA[ Franklin Regional School District ]]>
</DL>
</row>
</Data>

<?php
$xml = simplexml_load_file('filename');

foreach($xml->Data->row as $row) {
echo "<ul><li>".$row->DL[1]."</li></ul>";
}
?>

All Done..


No comments:

Post a Comment