Jump to content

Recommended Posts

Hi

 

I have used a webservice to obtain the follwoing XML response.

 

  <?xml version="1.0" encoding="utf-8" ?> 
  <string xmlns="http://www.webserviceX.NET"><?xml version="1.0" encoding="utf-16"?> <CurrentWeather> <Location>Antalya, Turkey (LTAI) 36-42N 030-44E 57M</Location> <Time>Feb 26, 2007 - 06:20 AM EST / 2007.02.26 1120 UTC</Time> <Wind> from the SE (140 degrees) at 9 MPH (8 KT) (direction variable):0</Wind> <Visibility> greater than 7 mile(s):0</Visibility> <SkyConditions> partly cloudy</SkyConditions> <Temperature> 64 F (18 C)</Temperature> <DewPoint> 50 F (10 C)</DewPoint> <RelativeHumidity> 59%</RelativeHumidity> <Pressure> 29.85 in. Hg (1011 hPa)</Pressure> <Status>Success</Status> </CurrentWeather></string> 

 

Now thats a bit too much info for my liking...All I wanted was perhaps the <SkyConditions> the<Temperature> and maybe <time>

 

When I have used other services I have had the response in an array, allowing me to return the key/value, but this comes as is.

 

How can I catch the variables within tags of my choice and ignore the others?

 

Hope you guys can help.

 

Will

Link to comment
https://forums.phpfreaks.com/topic/40159-parse-xml-and-find-a/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.