Turn OFF self-closing tags in SimpleXML for PHP?
问题 I'm building an XML document with PHP's SimpleXML extension, and I'm adding a token to the file: $doc->addChild('myToken'); This generates (what I know as) a self-closing or single tag: <myToken/> However, the aging web-service I'm communicating with is tripping all over self-closing tags, so I need to have a separate opening and closing tag: <myToken></myToken> The question is, how do I do this, outside of running the generated XML through a preg_replace ? 回答1: From the documentation at