PHP Classes
Icontem

File: Abs_Xml_Rss/AbsAtomReader10/example_read_atom_1.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Costin T  >  Abs_Xml_Rss  >  Abs_Xml_Rss/AbsAtomReader10/example_read_atom_1.php  
File: Abs_Xml_Rss/AbsAtomReader10/example_read_atom_1.php
Role: Example script
Content type: text/plain
Description: Example reading the content of an ATOM 1.0 feed
Class: Abs_Xml_Rss
Read and write RSS and Atom feeds
 

Contents

Class file image Download
<?php
    
# No cache headers
    
header("Expires: Mon, 05 June 2001 05:06:07 GMT");
      
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
    
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
    
header("Cache-Control: no-cache, must-revalidate");
    
header("Pragma: no-cache");

    include_once 
"class.AbsAtomReader10.php";


    
$xml = new AbsAtomReader10();
    
$xml->Load('xml/atom_1.xml');
//    $xml->Load('http://weblogs.asp.net/scottgu/atom.aspx');


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

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

    
// Get All Entries
    
$entries $xml->GetEntries();
    if (
is_array($entries) and count($entries)>0)
    {
        echo 
'<pre>';
        echo 
'<strong>Get all entries</strong><hr size="1" />';
        
print_r($entries);
        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 tags</strong><hr size="1" />';
        
print_r($all);
        echo 
'</pre>';
    }

?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products