function xmltoarr($path){//xml字符串轉數組
$xmlfile = file_get_contents($path);//提取xml文檔中的內容以字符串格式賦給變量
$ob= simplexml_load_string($xmlfile,'SimpleXMLElement', LIBXML_NOCDATA);//將字符串轉化為變量
$json = json_encode($ob);//將對象轉化為JSON格式的字符串
$configData = json_decode($json, true);//將JSON格式的字符串轉化為數組
return $configData;
}