Perche' print_r su un DOMDocument stampa un oggetto vuoto?
Esempio:
codice:
// codice XML
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
// codice PHP
<?php
$dom = simplexml_load_file('sample.xml');
print_r($dom);
$dom = new DOMDocument;
$dom->load('sample.xml');
print_r($dom);
var_dump($dom);
?>
// output
SimpleXMLElement Object
(
[to] => Tove
[from] => Jani
[heading] => Reminder
[body] => Don't forget me this weekend!
)
DOMDocument Object
(
)
object(DOMDocument)#2 (0) {
}