bleakcon
11-25-2010, 05:43 PM
Ok well let me first say thankyou to any help that is provided as well as a sorry if this is completly and utterly easy to implement.
So here is my problem: I currently have the following xml document
--------------------------------------------------------------------------
<?php
$xmlstr = <<<XML
<towns>
<town>
<name>Swindon</name>
<news>http://www.swindonadvertiser.co.uk/news/local/rss/</news>
<weather>http://weather.yahooapis.com/forecastrss?p=UKXX0147&u=f</weather>
</town>
<name>Chatanooga</name>
<news>http://feeds.feedburner.com/Chattanoogancom</news>
<weather></weather>
<name>Ocotal</name>
<news>http://www.topix.com/rss/ni/ocotal</news>
<weather> http://weather.yahooapis.com/forecastrss?p=MXOA1090&u=c</weather>
</town>
<name>Salzgitter</name>
<news>http://www.prlog.org/de,sn/rss.xml </news>
<weather> http://weather.yahooapis.com/forecastrss?p=GMXX0119&u=c</weather>
</town>
<name>Torun</name>
<news> http://www.topix.com/rss/pl/torun </news>
<weather> http://weather.yahooapis.com/forecastrss?p=PLXX0036&u=c</weather>
</town>
</towns>
?>
--------------------------------------------------------------------------
Now the only thing I would very much like to do is pull the name of say the first town using php then place that name into a html page. I assume this is a very simple task but upon googling I just felt that perhaps the solutions did not answer my specific problem.
Once again thanks for any help provided
So here is my problem: I currently have the following xml document
--------------------------------------------------------------------------
<?php
$xmlstr = <<<XML
<towns>
<town>
<name>Swindon</name>
<news>http://www.swindonadvertiser.co.uk/news/local/rss/</news>
<weather>http://weather.yahooapis.com/forecastrss?p=UKXX0147&u=f</weather>
</town>
<name>Chatanooga</name>
<news>http://feeds.feedburner.com/Chattanoogancom</news>
<weather></weather>
<name>Ocotal</name>
<news>http://www.topix.com/rss/ni/ocotal</news>
<weather> http://weather.yahooapis.com/forecastrss?p=MXOA1090&u=c</weather>
</town>
<name>Salzgitter</name>
<news>http://www.prlog.org/de,sn/rss.xml </news>
<weather> http://weather.yahooapis.com/forecastrss?p=GMXX0119&u=c</weather>
</town>
<name>Torun</name>
<news> http://www.topix.com/rss/pl/torun </news>
<weather> http://weather.yahooapis.com/forecastrss?p=PLXX0036&u=c</weather>
</town>
</towns>
?>
--------------------------------------------------------------------------
Now the only thing I would very much like to do is pull the name of say the first town using php then place that name into a html page. I assume this is a very simple task but upon googling I just felt that perhaps the solutions did not answer my specific problem.
Once again thanks for any help provided