Solved

Load xml and display data

Posted on 2014-03-05
2
349 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 500 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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.
The viewer will learn how to dynamically set the form action using jQuery.
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.

778 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