PHP笔记网

革命尚未成功,同志仍须努力下载JDK17

作者:Albert.Wen  添加时间:2013-09-13 15:43:02  修改时间:2024-12-16 04:27:28  分类:11.PHP基础  编辑

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();
}