我的 xml-php-script 有问题。XML 文档:http ://www.yr.no/place/Sweden/Stockholm/Stockholm/forecast.xml
$xmlstr = "http://www.yr.no/place/Sweden/Stockholm/Stockholm/forecast.xml";
//$vader = new SimpleXMLElement($xmlstr);
$vader = simplexml_load_file($xmlstr);
foreach ($vader->forecast->tabular->time->temperature as $temp) {
echo $temp->temperature, ' ', $temp->windSpeed, PHP_EOL;
}
我想要一个名为的变量中的温度:$temp