【发布时间】:2017-08-23 15:50:10
【问题描述】:
我有以下 PHP 代码:
$doc = new DOMDocument('1.0', 'UTF-8');
$node = $doc->create_element('markers');
$parnode = $doc->append_child($node);
由于某种原因,我得到了错误:
Call to undefined method DOMDocument::create_element()
我正在使用 Xampp 在 localhost 上对其进行测试,但我无法使其工作,知道可能出了什么问题吗?
【问题讨论】:
-
方法是
createElement和appendChild- 驼峰式,不是下划线 -
@iainn,你说得对,非常感谢。
标签: php