PHP Classes

File: example_RSS.php

Recommend this page to a friend!
  Classes of Armin  >  simpleTagReader  >  example_RSS.php  >  Download  
File: example_RSS.php
Role: Example script
Content type: text/plain
Description: example
Class: simpleTagReader
Extract values from tag based documents
Author: By
Last change:
Date: 14 years ago
Size: 578 bytes
 

Contents

Class file image Download
<?php
// read current weather conditions in Tabriz/Iran from Yahoo! Weather
require_once('class.simpleTagReader.php');

$City = "IRXX0016";
$Unit = "c"; // c or f
$yahooWeather = new simpleTagReader('http://xml.weather.yahoo.com/forecastrss?p='.$City.'&u='.$Unit.'');

$result = $yahooWeather->readAllTags('description');//first Tag: $result[0] & Second(Last) Tag: $result[1]
echo substr($result[1], 9, -3);

echo
"<br />OR<br />";

$result = $yahooWeather->readTag('description', 2);//to read first Tag: $yahooWeather->readTag('description', 1);
echo substr($result, 9, -3);
?>

For more information send a message to info at phpclasses dot org.