<?xml version="1.0" encoding="UTF-8"?>
<root>
<prognoza>
<id>Egipt</id>
<temp>
<w> 7.0</w>
<w> 8.0</w>
< w> 9.0</>
</temp>
</prognoza>
</root>
$root = simplexml_load_file('test.xml');
$wt = $root->prognoza->temp->w;
print_r($wt); echo '<br>';
foreach($wt as $w){
echo 'temp:' .$w. '<br/>';
}
Wynik:
SimpleXMLElement Object ( [0] => 7.0 )
temp: 7.0
temp: 8.0
temp: 9.0