simple-liveresults/xmlToJson.php
2020-09-29 14:55:17 +02:00

15 lines
347 B
PHP

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