07-07-2008, 12:44 PM
|
#1 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
|
why is my description limiter not working ?
PHP Code:
<?php
//only use when needed!
//ini_set("user_agent","Internet Explorer");
//Edit here for your rss link
$location = "http://youtube.com/rss/global/top_rated.rss";
$contents = file_get_contents($location);
$xml = new SimpleXMLElement($contents);
$limiter = 0;
$deslimit = $item->description = 0;
print "<ol>";
foreach($xml->channel->item as $item) {
print "<li>";
print "<a href='".$item->link."' title='".$item->title."'>";
print $item->title;
print "</a>";
print "<p>".$item->description."</p>";
print "</li>";
$limiter++;
if ($limiter == 5) break;
$deslimit++;
if ($deslimit == 100) break;
}
print "</ol>";
?>
Last edited by codefreek : 07-07-2008 at 01:05 PM.
Reason: Code edit!
|
|
|
|