所以我試圖Show results while script is still executing如何顯示結果,而PHP腳本仍在運行
,但由於某種原因,它不工作,所以這裏是我到目前爲止有:
ob_start();
include "../../common.php";
set_time_limit (0);
$start = (string) $_GET['start'];
$end = (string) $_GET['end'];
for($i = $start; strcmp($i, $end); $i = bcadd($i, 1)){
echo $i;
ob_flush();
}
ob_end_flush();
更新的代碼
*請注意,此代碼還沒有工作!
set_time_limit(0);
$start = $_GET['start'];
$end = $_GET['end'];
for(;$start < $end;$start++){
$content = file_get_contents("[some internal page]");
echo $content;
usleep(10);
flush();
}
我試過了你說的,但它不工作...這裏是我的php.ini設置,可能是這樣的:http://s135001.gridserver.com/gs-bin/phpinfo.php5 ??? – ahoura
嘿你的腳本工作,但是當我用我自己的一段代碼它停止工作! S:無論如何,我可以私下和你談談嗎? – ahoura
@ahoura我即將上牀睡覺(這裏是晚上11點),但我會在大約11個小時後回來,所以如果你願意,我會聊天。我的猜測是,你的問題是你沒有發送足夠的內容到瀏覽器來開始渲染。 – DaveRandom