我一直在试图让下面的代码工作。基于输出缓冲区的进度条
这是一个使用ob_get_clean()函数的进度条技巧。
不知道为什么,但这个脚本不工作!
只有初始百分比 - 1%出现,之后没有任何提示。
<?php
error_reporting(8191);
function flush_buffers(){
@ob_end_flush();
@ob_flush();
@flush();
@ob_start();
}
$ini = 2;
echo '<script>document.getElementById(\'lpt\').style.width=\'1%\';</script><br>';
for($i=1;$i<=100;$i++) {
$k=$ini-1;
$str=str_replace("width=\'$k%\'","width=\'$i%\'",ob_get_clean());
$ini++;
echo $str;
flush_buffers();
}
?>
我认为这是可能的使用Flex,但我不是很确定。 – pinaki 2010-05-06 11:30:11