简单的 XML 帮助!

发布于 2024-08-18 01:17:37 字数 167 浏览 4 评论 0原文

我需要一些帮助,

我需要做的就是将“HERE”更改为 $date 的值

$line1 = $sxe->addChild("date","HERE");

如何将 $date 的值添加到“HERE”所在的区域?

请帮忙

I need some help ,

All I need to do is change "HERE" to a the value of $date

$line1 = $sxe->addChild("date","HERE");

How can I add the value of $date into the area were "HERE" is ?

Please help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

云雾 2024-08-25 01:17:37
$sxe->addChild("date", $date);
$sxe->addChild("date", $date);
原来是傀儡 2024-08-25 01:17:37

编辑:实际上,除非date节点存在,否则以下内容不会起作用。听听其他人的意见...我们看到我实际使用 SimpleXml 修改结构的频率;-)

$sxe->date = $date;

EDIT: Actually the following wont work unless the date node exists. Listen to the others... We see how often i actually modify structure with SimpleXml ;-)

$sxe->date = $date;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文