I am writing some learning code to convert an XML file to a JavaScript array.
So far I can convert from XML to JSON with this:
<?php
$xmlStr = simplexml_load_file("xml/galleryXML.xml");
$jsonStr = json_encode($xmlStr);
?>
I don't know and can't find a way to convert to a JavaScript array object. Is there a clear method to do this? I can't find a method in PHP or JavaScript with a web search so far.
Thanks!