PHP输出XML文件函数

PHP输出XML文件函数

function xml_out($content, $charset = 'utf-8') {
	@header("Expires: -1");
	@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
	@header("Pragma: no-cache");
	@header("Content-type: application/xml; charset=$charset");
	echo '<' . "?xml version=\"1.0\" encoding=\"$charset\"?>\n";
	echo "<root><![CDATA[" . trim($content) . "]]></root>";
	exit();
}
posted @ 2016-07-14 11:13  52php  阅读(530)  评论(0编辑  收藏  举报