I'm using a foreach to loop through the results of an XML file. I'm loading it through a URL like this:
/feed/get_feed/0 where 0 equals the story I want to start displaying at. So if there are ten stories, and I put 0, the display will show all feeds starting at 0 (which is the first story). If I change it to 1, it displays all feeds starting at the second story. Makes sense.
But now I'm trying to say in the foreach loop "if this is the first story, do this. Else, do this."
$i = 0;
foreach ($xml->channel->item as $item):
if ($i >= $story):
if ($i == $i)
$result .= '<div>';
$result .= '<h1>'.$item->title.'</h1>';
$result .= '<p>'.$item->description.'</p>';
$result .= '</div>';
So how do I do that? I basically want to change the <div> to say <div class="top_story"> when it's the first story, and <div class="story"> when it's not the top story.