all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
9
Task/XML-DOM-serialization/PHP/xml-dom-serialization.php
Normal file
9
Task/XML-DOM-serialization/PHP/xml-dom-serialization.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
$dom = new DOMDocument();//the constructor also takes the version and char-encoding as it's two respective parameters
|
||||
$dom->formatOutput = true;//format the outputted xml
|
||||
$root = $dom->createElement('root');
|
||||
$element = $dom->createElement('element');
|
||||
$element->appendChild($dom->createTextNode('Some text here'));
|
||||
$root->appendChild($element);
|
||||
$dom->appendChild($root);
|
||||
$xmlstring = $dom->saveXML();
|
||||
Loading…
Add table
Add a link
Reference in a new issue