我收到以下错误: -
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++;
}
感谢任何帮助...
答案 0 :(得分:6)
使用严格标准,您应该实例化DOMDocument而不是静态调用loadXML
:
$xml_handle = new DOMDocument();
$xml_handle->loadXML($xml_datas, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);
这将消除错误。