25Sep/092
XML using PHP
This article helps those relatively new to using XML with PHP to write a short and uncomplicated XML file using the DOM in a PHP environment.
1. Create a new XML DOMDocument
$dom = new DomDocument('1.0', 'UTF-8');
Each XML document must have 1 and only 1 root element.
2. Create root node
$root = $dom->createElement('bookmarks');
$root = $dom->appendChild($root);
3. Create child node
$user = $dom->createElement('username', $userArray['Username']);
$root->appendChild($user);
4. Output XML
$xml_string = $dom->saveXML();
echo $xml_string;
October 22nd, 2009 - 21:23
Hello from Russia!
Can I quote a post in your blog with the link to you?
October 26th, 2009 - 01:51
Yes sure, go on