I am caputuring the contents for a file with ob_start() the contents are generated through a loop and within that loop I have another ob_start() outputting to a second file.
Like this
ob_start()
for(loop=0;$loop<=1000;$loop++){
ob_start();
?>
<p style="text-align:center"><?php echo $studentCounter.'/'.count($students);?></p>
<?php
file_put_contents('htmlpolling/'.$datePassed.$_SESSION['userCode'].'TTT'.$studentCounter.'.html', ob_get_clean());
}
file_put_contents('htmlpolling/'.$_SESSION['userCode'].'.html', ob_get_clean());
The files create successfully, but the files which are created inside the loop don't appear until the loop as finished and the final file is written.
Any reason for this?