Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

PHP/XML: Difference between revisions

From ZeroWiki
imported>beonit
No edit summary
 
imported>beonit
No edit summary
Line 14: Line 14:
     print $node->textContent . " ";
     print $node->textContent . " ";
  }
  }
----
[[PHP]], [[XML]]



Revision as of 01:14, 19 September 2008

PHP에서 XML 사용법

DOM

$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 . " ";
}

PHP, XML