当前位置: 代码迷 >> PHP >> 帮忙看一个小函数 不懂,该怎么处理
  详细解决方案

帮忙看一个小函数 不懂,该怎么处理

热度:551   发布时间:2012-03-08 13:30:13.0
帮忙看一个小函数 不懂
PHP code

    function CreateStatus($status)
    {
        $root = $this->dom->createElement('root');
        $this->dom->appendChild($root);
        //创建status标签
        $statusInfo = $this->dom->createElement('status');
        $root->appendChild($statusInfo);
        $statusInfoValue = $this->dom->createTextNode($status);
        $statusInfo->appendChild($statusInfoValue);
        
        //输出XML数据
        return $this->dom->saveXML();            
    }



不明白什么意思。。

------解决方案--------------------
上面不已经有注释了吗? 创建一个xml文件 并且将状态信息添加到xml里,返回xml 如果有错误将返回false.
  相关解决方案