Any chance the wonderful people here on daniweb could help me again with a loop? My apologies, loops are not my thing :| Basically what I'm trying to do is add a condition where on the last tweet (that is where the loop = $nooftweets), that tweet gets a different <span> class. Here's the function --

function get_tweets($twitter_id,
                    $afterTweetsHtml="</ul>") {
    if ( $twitter_xml = twitter_status($twitter_id) ) {
        $result = $beforeTweetsHtml;
        foreach ($twitter_xml->status as $key => $status) {
            if ($includeReplies == true |
                    substr_count($status->text,"@") == 0 |
                    strpos($status->text,"@") != 0) {
                $message = processLinks($status->text);
                if ($i == $nooftweets) break;
    else {
        $result.= $beforeTweetsHtml.
                    "<li id='tweet'>Twitter seems to be unavailable at the moment</li>".
    echo $result;

Actually got it figured out, maybe I'm not as bad as loops as I thought... :scared: