动态加载foreach循环

I have the following foreach loop:

                <?php
            ob_start();
            foreach ($streams as &$stream) {
                $array = stream($stream);
            ?>
                <a href="livestreams.php?stream=<?=$stream;?>">
                    <div class="channel-preview" style="background-image:url(<?=$array[2];?>);">
                        <div class="container">
                            <hgroup>
                                <h1><?=$array[4];?></h1>
                                <h2><?=$array[3];?></h2>
                            </hgroup>

                            <div class="meta">
                                <span class="live-viewers">Live Viewers:</strong> <?=$array[1];?></span>
                            </div>

                            <span class="game-badge starcraft-2" title="Starcraft 2"><span class="hide">Starcraft 2</span></span>
                        </div>
                    </div>
                </a>
            <?php
                    ob_flush();
                    flush();
                }
                ob_end_flush();
            ?>

Please note that this is only a part of the whole script. The problem with it is, that it loads fairly slow. I have tried to use ob_flush(); to speed it up as you can see, but there is no massive difference.

My problem is the loading time of the whole page. It takes some time for the page to even show in the browser. Would it be possible to use AJAX to load the loop while the page has already been rendered? Or is there any other method?

EDIT:

The that is being looped though is received from an external server, and that is most likely what is causing the delay. I should have stated this earlier.

Like a simple trick like this might work [as suggested on php.net]

<?php
// All you need is 256 spaces first
echo str_repeat(" ", 256)."<pre>"; flush();

// and ANY TAG before 

echo "working...<br/>
"; flush(); sleep(1); // this in cycle
?>

EDIT: Also adding a delay after the flush may solve the problem:

usleep(50000);// delay minimum of .05 seconds to allow ie to flush to screen

Please read more about flushing and suggested work-arounds in flushing problems here: http://php.net/manual/en/function.flush.php