i have an xml file in a special format how can i get specific tag value out of it for example if i want to get rotation value of each dict tag. as you can see that rotation value of each dict is nested in array tag that is nested in dist tag.please point me in right direction
<?xml version="1.0" encoding="UTF-8"?>
<pu version="1.0">
<dict>
<key>ID</key>
<string>C0AC8773-CEE6-4A12-9C69-320A1BDB7255</string>
<key>Items</key>
<array>
<dict>
<key>opacity</key>
<real>1</real>
<key>Thickness</key>
<real>0</real>
<key>repeat</key>
<false/>
<key>rotation</key>
<real>90</real>
</dict>
<dict>
<key>opacity</key>
<real>1</real>
<key>Thickness</key>
<real>0</real>
<key>repeat</key>
<false/>
<key>rotation</key>
<real>180</real>
</dict>
<dict>
<key>opacity</key>
<real>1</real>
<key>Thickness</key>
<real>0</real>
<key>repeat</key>
<false/>
<key>rotation</key>
<real>270</real>
</dict>
</array>
</dict>
</pu>
this is what i tried so far
$dom = new DOMDocument;
$dom->load($path);
$array = $dom->getElementsByTagName('array');
foreach($array as $key)
{
print_r($key);
}
this will print all tags inside array tags but i want only rotation value