PHP Classes

File: Abs_Xml_Rss/AbsRssReader20/example_read_xml_2.php

Recommend this page to a friend!
  Packages of Costin Trifan   Abs_Xml_Rss   Abs_Xml_Rss/AbsRssReader20/example_read_xml_2.php   Download  
File: Abs_Xml_Rss/AbsRssReader20/example_read_xml_2.php
Role: Example script
Content type: text/plain
Description: How to use this class
Class: Abs_Xml_Rss
Read and write RSS and Atom feeds
Author: By
Last change:
Date: 17 years ago
Size: 895 bytes
 

 

Contents

Class file image Download
<?php
    include_once "class.AbsRssReader20.php";

    $xml = new AbsRssReader20();


    $xml->Load('xml/rss_2.xml');
//    $xml->Load('http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml');


    // Get Channel Tags
    $chTags = $xml->GetChannelTags();
    if (is_array($chTags) and count($chTags)>0)
    {
        echo '<pre>';
        echo '<strong>Get Channel Tags</strong><hr size="1" />';
        print_r($chTags);
        echo '</pre>';
    }

echo '<p><br/></p>';

    // Get Items
    $chItems = $xml->GetItems();
    if (is_array($chItems) and count($chItems)>0)
    {
        echo '<pre>';
        echo '<strong>Get Items</strong><hr size="1" />';
        print_r($chItems);
        echo '</pre>';
    }

echo '<p><br/></p>';

    // Get ALL
    $all = $xml->GetAll();
    if (is_array($all) and count($all)>0)
    {
        echo '<pre>';
        echo '<strong>Get ALL</strong><hr size="1" />';
        print_r($all);
        echo '</pre>';
    }
?>