Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Load xml and display data

Posted on 2014-03-05
2
Medium Priority
?
355 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
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

877 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