gpt4 book ai didi

php - DOMDocument::getElementById 返回 NULL

转载 作者:行者123 更新时间:2023-12-04 23:22:01 32 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Simplify PHP DOM XML parsing - how?

这是我的 XML (c.xml):

<?xml version="1.0" encoding="utf-8"?>
<root>
<head>
<title id="title">Hello</title>
</head>
</root>

我的工作:

$dom = new DOMDocument;

$dom->load('./c.xml');

var_dump($dom->getElementById('title'));die(); // returns NULL

这里有什么问题&?

UPD

$dom->validate(); 返回 DOMDocument::validate(): no DTD found!

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com