Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Load xml and display data

Posted on 2014-03-05
2
Medium Priority
?
354 Views
Last Modified: 2014-03-05
Hi Experts,

I am trying to load this xml - http://www.onthesnow.co.uk/austria/snow-rss.html - and display the <title> and <ots:base_depth>.

I have successfully got the title but can't seem to get the ots:base_depth

Any help would be hugely appreciated

<?php
$xml = simplexml_load_file("http://www.onthesnow.co.uk/austria/snow-rss.html");

foreach($xml->channel->item  as $resort) {
	
	echo $resort->title;
	echo $resort->description;
	
}

Open in new window

0
Comment
Question by:mcluff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 2000 total points
ID: 39907097
Try this:

echo $resort->children('ots', true)->base_depth;
0
 

Author Closing Comment

by:mcluff
ID: 39907104
Many thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question