PHP Classes

File: USAGE

Recommend this page to a friend!
  Classes of James Logdson   Syndication Classes   ???   Download  
File: ???
Role: Documentation
Content type: text/plain
Description: USAGE File
Class: Syndication Classes
Generate XML and RSS feeds
Author: By
Last change:
Date: 20 years ago
Size: 1,087 bytes
 

Contents

Class file image Download
USAGE for Syndication Classes class XML ++++++++++++++++++++++++++++++++++++++++ $XML = new XML ( "1.0" ); // Uncomment to enable debugging //$XML->debug = true; $XML->openTag ( 'myTag' ); $XML->openTag ( 'anotherTag', array ( 'attribute'=>'value','perm'=>'true' ) ); $XML->addValue ( 'This tag has attributes' ); $XML->openTag ( 'thisHasNoClose', null, true ); $XML->closeTag ( ); // Closes 'anotherTag' $XML->closeTag ( ); // Closes 'myTag' echo $XML->Go(); // Output class RSS ++++++++++++++++++++++++++++++++++++++++ $info = Array ( 'title' => 'Site Title', 'link' => 'http://example.com', 'description' => 'Some information on the site', 'pubDate' => date ( 'r' ), 'category' => 'Personal' ); $RSS = new RSS ( $info ); // Add posts $post[1] = Array ( 'title' => 'Post Title', 'link' => 'http://site.com/post/1', 'description' => 'The post goes here for real', 'author' => 'Admin', 'guid' => array('http://site.com/post/1',true), 'pubDate' => date ( 'r' ) ); foreach ( $post as $info ) { $RSS->addItem ( $info ); }