请问在这里如何把 $strXML 的内容写到一个XML文件当中,谢谢啊
<?php
include("inc/conn.php");
$TrueCorr=$_GET["TrueCorr"];
$r_XX=$_GET["r_XX"];
$r_YY=$_GET["r_YY"];$link = connectToDB();
$strXML = "<chart palette='' caption='' numDivLines='10' yAxisName='' xAxisName='' rotateNames='0' showLegend='1' showNames='1' xAxisMaxValue='100' xAxisMinValue='0' yAxisMaxValue='7' decimals='1'>";
$strXML .= "<categories verticalLineColor='666666' verticalLineThickness='1'>";
$strXML .= "<category label='10' x='10' showVerticalLine='1'/>";
$strXML .= "<category label='20' x='20' showVerticalLine='1'/>";
$strXML .= "<category label='30' x='30' showVerticalLine='1'/>";
$strXML .= "<category label='40' x='40' showVerticalLine='1'/>";
$strXML .= "<category label='50' x='50' showVerticalLine='1'/>";
$strXML .= "<category label='60' x='60' showVerticalLine='1'/>";
$strXML .= "<category label='70' x='70' showVerticalLine='1'/>";
$strXML .= "<category label='80' x='80' showVerticalLine='1'/>";
$strXML .= "<category label='90' x='90' showVerticalLine='1'/>";
$strXML .= "<category label='100' x='100' showVerticalLine='1'/>";
$strXML .= "</categories>";
$strXML .= "<dataSet seriesName='' color='009900' anchorSides='8' anchorRadius='4' anchorBgColor='D5FFD5' anchorBorderColor='009900' >";
// Fetch all factory records $strQuery = "select * from erm605_points where TrueCorr='".$TrueCorr."' and r_XX='".$r_XX."' and r_YY = '".$r_YY."'"; //Iterate through each factory
if ($result) {
while($ors = mysql_fetch_array($result)) { $strXML .= "<set y='" . $ors['Y'] . "' x='" . $ors['X'] . "'/>";
//echo $ors['Y'];
//free the resultset
}
}
$strXML .= "</dataSet>";
$strXML .= "</chart>";
echo $strXML; // 请问在这里如何把 $strXML 的内容写到一个XML文件当中。
mysql_close($link);
?>
<?php
include("inc/conn.php");
$TrueCorr=$_GET["TrueCorr"];
$r_XX=$_GET["r_XX"];
$r_YY=$_GET["r_YY"];$link = connectToDB();
$strXML = "<chart palette='' caption='' numDivLines='10' yAxisName='' xAxisName='' rotateNames='0' showLegend='1' showNames='1' xAxisMaxValue='100' xAxisMinValue='0' yAxisMaxValue='7' decimals='1'>";
$strXML .= "<categories verticalLineColor='666666' verticalLineThickness='1'>";
$strXML .= "<category label='10' x='10' showVerticalLine='1'/>";
$strXML .= "<category label='20' x='20' showVerticalLine='1'/>";
$strXML .= "<category label='30' x='30' showVerticalLine='1'/>";
$strXML .= "<category label='40' x='40' showVerticalLine='1'/>";
$strXML .= "<category label='50' x='50' showVerticalLine='1'/>";
$strXML .= "<category label='60' x='60' showVerticalLine='1'/>";
$strXML .= "<category label='70' x='70' showVerticalLine='1'/>";
$strXML .= "<category label='80' x='80' showVerticalLine='1'/>";
$strXML .= "<category label='90' x='90' showVerticalLine='1'/>";
$strXML .= "<category label='100' x='100' showVerticalLine='1'/>";
$strXML .= "</categories>";
$strXML .= "<dataSet seriesName='' color='009900' anchorSides='8' anchorRadius='4' anchorBgColor='D5FFD5' anchorBorderColor='009900' >";
// Fetch all factory records $strQuery = "select * from erm605_points where TrueCorr='".$TrueCorr."' and r_XX='".$r_XX."' and r_YY = '".$r_YY."'"; //Iterate through each factory
if ($result) {
while($ors = mysql_fetch_array($result)) { $strXML .= "<set y='" . $ors['Y'] . "' x='" . $ors['X'] . "'/>";
//echo $ors['Y'];
//free the resultset
}
}
$strXML .= "</dataSet>";
$strXML .= "</chart>";
echo $strXML; // 请问在这里如何把 $strXML 的内容写到一个XML文件当中。
mysql_close($link);
?>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货