每一个载入浏览器都会生成一个 Document 对象。

Document 对象使我们可以从脚本中对 HTML 页面中的所有元素进行访问。Document 对象是 Window 对象的一部分。

我们项目中需要使用第三方支付,第三方支付文件使用了DOMDocument,我们框架使用的是TP5。

		$dom = new DOMDocument();
		$dom->loadXML($ReData);

  

如果直接使用DOMDocument的话会报一个错误

Thinkphp 5 使用DOMDocument

 

解决办法很简单,只需要在DOMDocument加上一个反斜杠就ok了

        $dom = new \DOMDocument();
        $dom->loadXML($ReData);

 

相关文章:

  • 2021-10-03
  • 2021-05-23
  • 2021-09-12
  • 2021-12-10
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
  • 2022-12-23
  • 2022-12-23
  • 2021-07-11
  • 2021-11-17
相关资源
相似解决方案