Anyone that knows PHP and XML out there? Then please have a look!
This is my PHP code:
$xml = simplexml_load_file(\"movies.xml
Try This one
$xml = ... // Xml file data
$Json = Xml_to_Json($xml);
$array = json_decode($Json,true);
echo '<pre>'; print_r($array);
foreach ($array as $key => $value) {
foreach ($value as $key1 => $value1) {
echo '<h2>'.$value1['title'].'</h2>
<p>Year: '.$value1['year'].'</p>
<p>Category: ';
foreach ($value1['regions']['region']['categories']['categorie'] as $categoriekey => $categorie) {
echo $categorie.' ';
}
echo 'Animation</p>
<p>Country: '.$value1['regions']['region']['countries']['country'].'</p>';
}
}
function Xml_to_Json($array){
$xml = simplexml_load_string($array, "SimpleXMLElement", LIBXML_NOCDATA);
$json = json_encode($xml);
return $json;
}