gpt4 book ai didi

php - SimpleXMLElement 对象,键中带有 @ 和破折号

转载 作者:行者123 更新时间:2023-12-03 09:26:00 24 4
gpt4 key购买 nike

我的 SimpleXMLElement 对象看起来像这样

    SimpleXMLElement Object (
[report-name] = SimpleXMLElement Object
(
[@attributes] = Array
(
[name] = Raport
)

)

[date-range] = SimpleXMLElement Object
(
[@attributes] = Array
(
[date] = Jan 29, 2014
)

) )

如何从中获取“日期”值?

最佳答案

来源:PHP website , W3 Schools website

有关简单 XML 对象的基本用法,请参阅 W3 学校的链接。

要解决您的连字符问题,请参阅直接来自 PHP 网站的示例:

$xml = simplexml_load_string($input);
$callback = $xml->{"callback-url"};

关于php - SimpleXMLElement 对象,键中带有 @ 和破折号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21428502/

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