The namespace is the third parameter to addChild()
$item->addChild('id', 'myid', 'http://base.google.com/ns/1.0');
See the documentation for more information.
More Related Contents:
- Reference – How do I handle Namespaces (Tags and Attributes with a Colon in their Name) in SimpleXML?
- Remove a child with a specific attribute, in SimpleXML for PHP
- Simple XML – Dealing With Colons In Nodes
- Get value from SimpleXMLElement Object
- Forcing a SimpleXML Object to a string, regardless of context
- Parse XML with Namespace using SimpleXML [duplicate]
- How to get the value of an attribute from XML file in PHP?
- PHP library for parsing XML with a colons in tag names? [duplicate]
- parse an XML with SimpleXML which has multiple namespaces [duplicate]
- PHP namespace simplexml problems
- Implementing condition in XPath [duplicate]
- SimpleXML – Remove xpath node
- How to write CDATA using SimpleXmlElement?
- How can I set text value of SimpleXmlElement without using its parent?
- Using SimpleXML to read RSS feed
- PHP SimpleXML: insert node at certain position
- ‘xmlParseEntityRef: no name’ warnings while loading xml into a php file
- SimpleXML: Working with XML containing namespaces
- How to Paginate lines in a foreach loop with PHP
- Loop through an XML object with SimpleXML
- PHP convert XML to JSON group when there is one child
- simplexml error handling php
- PHP SimpleXML Namespace Problem
- Getting the text portion of a node using php Simple XML
- PHP, SimpleXML, decoding entities in CDATA
- Getting actual value from PHP SimpleXML node [duplicate]
- Get root node of XML doc using simplexml
- php SimpleXML attributes are missing
- Remove namespace from XML using PHP
- How to import XML string in a php DOMDocument