{ $this->_WalkTree($tree->child[$i]); } $this->TreeData .= '</'.$tree->TagName.">\n"; } //获取错误信息 function GetError() { return $this->error; } //获取树的最大深度 function GetMaxDepth() { return $this->MaxDepth; } //将xml树写入xml文件 function WriteToFile($file,$head='') { $fp = fopen($file,'w'); if(!$fp) { $this->error = '无法打开写入文件'; return false; } if(empty($this->TreeData)) $this->WalkTree(); $head = empty($head)?'<?xml version="1.0" standalone="yes" encoding="gb2312"?>':$head; fwrite($fp,$head); fwrite($fp,$this->TreeData); fclose($fp); return true; } } ?>
(出处:清风网络学院)
上一篇:PHP程序的常见漏洞攻击分析
下一篇:smarty实例教程
|