Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将 Moo 设置为元素,如下所示:
$xmlEl = new SimpleXMLElement('<Get>Moo</Get>');
如果我这样初始化元素:
$xmlEl = new SimpleXMLElement('<Get></Get>');
这是一件简单得可笑的事情。但我知道它既不是 addAttribute() 也不是 addChild()。
提前致谢
设置根元素的值:
<?php $xmlEl = new SimpleXMLElement('<Get></Get>'); $xmlEl[0] = 'Moo'; ?>