I am trying to convert an xml feed to json, but using this code it fails to do anything. Any ideas?
<?php
$xml_string = 'https://xml.betfred.com/Horse-Racing-Daily.xml';
//read the XML file
$xml = file_get_contents($xml_string);
//encode the formatted data
$json = json_encode();
//generate the JSON file
header('Content-Type: application/json');
echo $json;
?>