Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 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