Calling ob_flush() and flush(), yet browser doesn't show any output until script finishes

后端 未结 12 2838
离开以前
离开以前 2020-12-07 00:55

Hi Please View Below Code :

\\n\";
for( $i = 0 ; $i < 10 ; $i++ )
{
    echo \"$i
\\n\";
12条回答
  •  没有蜡笔的小新
    2020-12-07 00:57

    Hey man I was also got stuck in this problem and finally got the correct solution here it is for you

    you have to add content type for your page you can do that by two ways 1. using html tag

    
    

    Ex.

    
    
    
    
    Wp Migration
    
    
    ';
    ob_flush();
    flush();
    sleep(3);
    }
    ?>
    
    
    
    1. using php header function

    Ex.

    ';
    ob_flush();
    flush();
    sleep(3);
    }
    ?>
    

    All the best

提交回复
热议问题