# wp-forecast/2.6/examples/xml2csv.php

wp-forecast, version 2.6. 23 lines.

- Page: https://pluginprobe.com/plugins/wp-forecast/2.6/code/examples/xml2csv.php
- Raw: https://pluginprobe.com/plugins/wp-forecast/2.6/raw/examples/xml2csv.php
- Modified: 2009-06-18T08:16:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-forecast/2.6/code/examples/xml2csv.php#L10-L20`.

```php
<?php 
$xmlfile="examples/weather_bug_example.xml";

 // XML-Daten laden 
$xmlDom = new domdocument; 
$xmlDom->load($xmlfile); 
 

$location = $xmlDom->getElementsByTagName('station'); 
echo $location->item(0)->nodeValue."\n";     

$realfeel = $xmlDom->getElementsByTagName('feels-like'); 
echo $realfeel->item(0)->nodeValue."\n";     
echo $realfeel->item(0)->getAttribute("units")."\n";

$obsdate = $xmlDom->getElementsByTagName('ob-date');
$od = $obsdate->item(0)->childNodes; 
foreach ($od as $y) {
  echo $y->getAttribute("number")." ";
}
echo "\n";
?>

```
