-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample.php
More file actions
30 lines (26 loc) · 710 Bytes
/
example.php
File metadata and controls
30 lines (26 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
include('RssGenerator.php');
$articles = array(
1 => array(
'title' => 'title1',
'desc' => 'desc1',
'link' => 'http://example.com/1.html',
'cdate' => '2013-01-01 10:10:59',
),
2 => array(
'title' => 'title2',
'desc' => 'desc2',
'link' => 'http://example.com/2.html',
'cdate' => '2013-01-01 10:11:59',
),
);
$rss = new RssGenerator();
$rss->set('title', 'this is a title.');
foreach ($articles as $i => $a) {
$items[$i]['title'] = $a['title'];
$items[$i]['description'] = $a['desc'];
$items[$i]['link'] = $a['link'];
$items[$i]['pubDate'] = $a['cdate'];
}
echo $rss->get($items);
?>