/**
* 数组转换成xml
* @param $arr
* @return string
*/
function array_to_xml($arr){
$xml = '<?xml version="1.0" encoding="UTF-8"?><xml>';
foreach ($arr as $key=>$val) {
if (is_numeric($val)){
$xml.="<".$key.">".$val."</".$key.">";
}else{
$xml.="<".$key."><![CDATA[".$val."]]></".$key.">";
}
}
$xml.="</xml>";
return $xml;
}