Page 1 of 1

while statement isn't working

Posted: Thu Mar 10, 2011 6:08 pm
by someguyhere
Does anyone see any reason this while statement returns all results instead of limiting them?

Code: Select all

$i = 0;
while ($i < 2) {
	foreach ($rss->items as $item ) {
		$title = $item[title];
		$url = $item[link];
		$desc = $item[description];
		$rss_feed .= "<li><a href=$url>$title</a><br />$desc</li>";
		$i++;
	}
}