我得到以下错误:

Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically

在下线
$xml_handle = DOMDocument::loadXML($xml_datas, LIBXML_NOENT
 | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);

以下代码:
while(($xml_index = $zip_handle->locateName("ppt/slides/slide".$slide_number.".xml")) !== false){
            $xml_datas = $zip_handle->getFromIndex($xml_index);
            //die("here ====".$slide_number.$xml_datas);
            $xml_handle = DOMDocument::loadXML($xml_datas, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);
            //print_r($xml_handle);die($xml_handle);
            $output_text.= strip_tags($xml_handle->saveXML() );
            $slide_number++;
        }

感谢您的帮助…

最佳答案

使用严格的标准,您应该实例化domdocument,而不是静态调用loadXML

$xml_handle = new DOMDocument();
$xml_handle->loadXML($xml_datas, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);

这将消除错误。

10-07 18:09