Contoh script sederhana membuat data xml pada php.
<?php
$xml = ‘<item text=”WEB” id=”0″>’;
$xml.= ‘<item text=”HOME” id=”1″>’;
$xml.= ‘<item text=”HOME 1″ id=”1.1″ />’;
$xml.= ‘<item text=”HOME 2″ id=”1.2″ />’;
$xml.= ‘</item>’;
$xml.= ‘<item text=”REPORT” id=”2″>’;
$xml.= ‘<item text=”REPORT 1″ id=”2.1″ />’;
$xml.= ‘<item text=”REPORT 2″ id=”2.2″ />’;
$xml.= ‘</item>’;
$xml.= ‘</item>’;header(”Content-type: text/xml”);
echo ‘<?xml version=”1.0″ encoding=”UTF-8″?>’;
echo $xml;
exit;
?>



0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.