Solved

Load xml and display data

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
c# code 19 61
microsoft access - xml 10 30
How to install phpMyAdmin on AWS Elastic Beanstalk 2 38
Wordpress Body Class 5 15
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now