zl程序教程

您现在的位置是:首页 >  后端

当前栏目

PHP输出XML文件函数

2023-09-14 08:57:27 时间

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