sleep
暂停执行。语法: void sleep(int seconds);传回值: 无函式种类: PHP 系统功能
 
 
内容说明 
本函式可暂时使程式停止执行。参数 seconds 为要暂停的秒数。

解决方案 »

  1.   

    我这样写可以吗?可是并没有出现我所要实现的功能呵
    <?
    for ($i;$i<10;$i++)
    {
    echo $i."<BR>";
    sleep(1);
    }
    ?>
      

  2.   

    <?
    for ($i;$i<10;$i++){
    print($i."<BR>");
    flush();
    sleep(1);
    }
    ?>
      

  3.   

    秋水的代码好像还是不行?是不是需要设置什么的??????
    我用php+js实现:<body>
    <div id=xxx></div>
    <?
    echo "<script>\n";
    echo "var arr=new Array();\n";
    for($i=0; $i < 10; $i++){
    echo "arr[$i]=$i;\n";
    }
    echo "</script>\n";
    ?>
    <script>
    n=0;
    function listXXX(){
    if(n>=arr.length){
    clearInterval(aa);return;
    }
    xxx.innerHTML+=arr[n]+"<BR>";
    n++;
    }
    aa=setInterval("listXXX()",1000)
    </script>
    </body>
      

  4.   

    我这里通过,你那flush()无效? 
    flush
    (PHP 3, PHP 4 >= 4.0.0)flush -- Flush the output buffer Note: flush() has no effect on the buffering scheme of your webserver or the browser on the client side. <?
    for ($i;$i<10;$i++){
    print($i."<BR>");
    flush();
    sleep(1);
    }
    ?>
      

  5.   

    PHP Version 4.0.6 + winxpyou can try other functionsLXXII. Output Control FunctionsTable of Contents
    flush — Flush the output buffer
    ob_clean — Clean (erase) the output buffer 
    ob_end_clean — Clean (erase) the output buffer and turn off output buffering 
    ob_end_flush — Flush (send) the output buffer and turn off output buffering 
    ob_flush — Flush (send) the output buffer 
    ob_get_contents — Return the contents of the output buffer 
    ob_get_length — Return the length of the output buffer 
    ob_get_level — Return the nesting level of the output buffering mechanism 
    ob_gzhandler — ob_start callback function to gzip output buffer 
    ob_implicit_flush — Turn implicit flush on/off 
    ob_start — Turn on output buffering
      

  6.   

    我还用过ob_flush都不行其它的应该更没用