PHP Classes

File: sample.php

Recommend this page to a friend!
  Classes of yinsee   XMLTree   sample.php   Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Sample script
Class: XMLTree
Parse and cache XML documents
Author: By
Last change:
Date: 16 years ago
Size: 331 bytes
 

Contents

Class file image Download
<?
/* grab the most-interesting Flickr */
$db = new XMLTree("http://feeds.feedburner.com/InterestingFlickrNoFlowers?format=xml");

/* show the first item's title */

// the ugly way
print_r($db->xml_array['root']['rss']['channel']['item'][0]['title']);

// the OO way
print_r($db->root->rss->channel->item[0]->title);
?>