Ciao.
file xml.php (pensate che lo potevo fare
in modo dinamico con un result mysql )
Codice PHP:
<?php
$xmlstr = "<?xml version=\"1.0\" standalone=\"yes\"?>";
$xmlstr .= "<movies>\n<movie>Behind the Parser</movie>\n</movies>\n";
header('Content-type: text/xml; charset=utf-8');
echo $xmlstr;
?>
file loadXml
Codice PHP:
<?php
if (file_exists('xml.php')) {
$xml = simplexml_load_file('xml.php');
var_dump($xml);
} else {
exit('Failed to open test.xml.');
}
?>
E l'errore:
Warning: xml.php:2: parser error : Start tag expected, '<' not found in f:\wamp\www\xml\example\mioplot.php on line 3
Warning: $xmlstr = ""; in c:\xxx\www\xml\example\loadXml.php on line 3
Warning: ^ in c:\xxx\www\xml\example\loadXml.php on line 3
bool(false)
Il file xml.php è un valido file xml
quindi non capisco il perchè dell'errore
c'è qc che mi spiega l'arcano.
(Provato sia da locale che su web)