How to get XML data and convert to JSON with PHP

How could I get the XML data similar to the loaded data at the following location and convert it to JSON with PHP?

https://secure.activecarrot.com/public/session/browse_raw/1242/1/582/2020-12-22

I tried this but it returns false:

$url = “https://secure.activecarrot.com/public/session/browse_raw/1242/1/582/2020-12-22”;

$xml = simplexml_load_file($url);

print_r($xml);

$json = json_encode($xml);
1 Like
Sponsor our Newsletter | Privacy Policy | Terms of Service