simple-liveresults/xmlToJson.php
2023-11-27 14:06:48 +01:00

16 lines
346 B
PHP
Executable File

<?php
libxml_use_internal_errors(TRUE);
$objXmlDocument = simplexml_load_file("resultater/results.xml");
if ($objXmlDocument === FALSE) {
foreach(libxml_get_errors() as $error) {
//error
}
exit;
}
$objJsonDocument = json_encode($objXmlDocument);
$arrOutput = json_decode($objJsonDocument, TRUE);
echo $objJsonDocument;
?>