How would i stop this foreach loop after 3 iterations?

Posted by Tapha on Stack Overflow See other posts from Stack Overflow or by Tapha
Published on 2010-05-19T12:20:53Z Indexed on 2010/05/19 13:00 UTC
Read the original article Hit count: 182

Filed under:

Here is the loop.

foreach($results->results as $result){
                                    echo '<div id="twitter_status">';
                                    echo '<img src="'.$result->profile_image_url.'" class="twitter_image">';
                                    $text_n = $result->text; 
                                    echo "<div id='text_twit'>".$text_n."</div>";
                                    echo '<div id="twitter_small">';
                                    echo "<span id='link_user'".'<a href="http://www.twitter.com/'.$result->from_user.'">'.$result->from_user.'</a></span>';
                                    $date = $result->created_at;

                                    $dateFormat = new DateIntervalFormat();

                                    $time = strtotime($result->created_at);

                                    echo "<div class='time'>";

                                    print sprintf('Submitted %s ago',  $dateFormat->getInterval($time));

                                    echo '</div>';

                                    echo "</div>";
                                    echo "</div>";

Thanks!!!! alot.

© Stack Overflow or respective owner

Related posts about php