比如说把下列代码生成一个以时间命名的XML文件: <?xml version="1.0" encoding="gb2312" ?>
<html author="axgle">
<head>
<title>this is title</title>
</head>
<body>
<p id="1">this is p1</p>
<p id="2">this is p2</p>
</body>
</html>请达人指点。。谢谢!~~给分。。
<html author="axgle">
<head>
<title>this is title</title>
</head>
<body>
<p id="1">this is p1</p>
<p id="2">this is p2</p>
</body>
</html>请达人指点。。谢谢!~~给分。。
<html author="axgle">
<head>
<title>this is title</title>
</head>
<body>
<p id="1">this is p1</p>
<p id="2">this is p2</p>
</body>
</html>';
$filename = time().'.xml';
$fp = fopen($filename, 'w');
fwrite($fp, $content);
fclose($fp);确保你有对应目录的写入权限先,
http://www.ibm.com/developerworks/cn/opensource/os-xmldomphp/