logo.gif (2199 bytes)

Google

 Home | Travel | Chat | Entertainment | Education | E-Cards | TEL.DIR | News| Sports | ForexFashion | Food | Jobs | Web2SMS

 Daily Pakistan and World News Headlines

";*/ } $i=$i+1; } class RSSParser { var $in_item, $tag, $item, $items, $parser, $rss_data, $error; function RSSParser($rss_file = "http://hwhell.com/xml/feature_feed.rss") { $this->rss_data = file_get_contents($rss_file); $this->parser = xml_parser_create(); xml_set_object($this->parser, $this); xml_set_element_handler($this->parser, 'startElement', 'endElement'); xml_set_character_data_handler($this->parser, 'characterData'); } function parse() { if (!xml_parse($this->parser, $this->rss_data, true)) { $this->error = xml_error_string(xml_get_error_code($this->parser)).": ".xml_get_current_line_number($this->parser); return false; } return $this->items; } function startElement($parser, $tagname, $attrs) { if ($this->in_item) { $this->tag = $tagname; } else if ($tagname == 'ITEM') { $this->in_item = true; } } function endElement($parser, $tagname) { $this->tag = ''; if ($this->in_item && $tagname == 'ITEM') { unset($this->item['']); $this->items[] = $this->item; $this->in_item = false; } } function characterData($parser, $data) { $this->item[$this->tag] = $data; } } ?>
parse(); $i=0; // Present the data: foreach ($items as $item) { if($i> 0 ){ printf("

%s

", trim($item['LINK']),trim($item['TITLE']),htmlspecialchars(trim($item['TITLE']))); printf("%s", htmlspecialchars(trim($item['PUBDATE']))); printf("
%s", htmlspecialchars(trim($item['DESCRIPTION']))); /*echo "
{$item['TITLE']} - {$item['PUBDATE']}
{$item['DESCRIPTION']}

© Copyright 2001-2007, NicePakistan.com. All Rights Reserved. || Terms of Use || Feedback ||  Advertisement || Contact Us ||