PHP에서 XML 사용법

DOM

* 원문(http://devzone.zend.com/node/view/id/1713#Heading7) --> php로 xml다루는 방법을 아주 쉽게 설명했네요
~php
$dom = new DomDocument();

$dom->load("articles.xml");

$dom->load("file:///articles.xml");

// If you want to output the XML document to the browser or as standard output, use:
print $dom->saveXML();

// If you want to save it to a file, use:
print $dom->save("newfile.xml");

//
$titles = $dom->getElementsByTagName("title");
foreach($titles as $node) {
   print $node->textContent . " ";
}



Retrieved from http://wiki.zeropage.org/wiki.php/XML/PHP
last modified 2021-02-07 05:28:27