Zend Feed

30.Jun.2010

To create RSS Feed using Zend Feed, you can use following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
	$items = array(0, 1, 2, 3);
 
	foreach ($texts AS $text)
		$items[] = array(
			'title'		=> 'Zend Feed title',
			'link'		=> 'http://example.com',
			'description'	=> 'Zend Feed description',
			'pubDate'	=> '2010-06-30 13:25:00'
		);
 
	// make RSS Feed array
	$rss = array(
		'title'   => 'Some RSS Feed title',
		'link'    => 'http://example.com/',
		'charset' => 'UTF-8',
		'entries' => $items
	);
 
	$feed = Zend_Feed::importArray($rss, 'rss');
 
	echo $feed->saveXML();