php生成xml简短代码
<?php$doc=new DOMDocument('1.0', 'UTF-8');
$doc->formatOutput=true;
$php100=$doc->createElement_x('php100');
$php1000=$doc->createElement_x('php1000');
$php10000=$doc->createElement_x('title');
$php20000=$doc->createElement_x('content');
$val=$doc->createTextNode('333333333');
$val2=$doc->createTextNode('2222222222');
$val3=$doc->createTextNode('new');
$xmlnew=$doc->createAttribute('xmlnew');
$php20000->appendChild($val2);
$php10000->appendChild($val);
$php100->appendChild($php1000);
$php1000->appendChild($xmlnew);
$php1000->appendChild($php20000);
$php1000->appendChild($php10000);
$xmlnew->appendChild($val3);
$doc->appendChild($php100);
$doc->save('php.xml');
?>
<?xml version="1.0" encoding="UTF-8"?>
<php100>
<php1000 xmlnew="new">
<content>2222222222</content>
<title>333333333</title>
</php1000>
</php100>