Çıkış köprüsü her seferinde bir yerine, bir kerede?

0 Cevap

I'm running PHP SOAP and the loop runs with 10 iterations. The issue I am having is that it will not output until the loop is complete, whereby displaying every output at once.
How can I have it output one at a time as it processes through the loop rather than all in one go after it completes the entire 10 loops?

<?php

$loops = 0; // set loops to 0

// connection credentials and settings
$location = 'https://theconsole.com/';
$wsdl = $location.'?wsdl';
$username = 'user';
$password = 'pass';

// include the console and client classes
include "class_console.php";
include "class_client.php";

// create a client resource / connection
$client = new Client($location, $wsdl, $username, $password);

while ($loops < 10)   
    {
    $dostuff;
    $echo "It has done: " .$stuff; // display output
    ob_end_flush(); ob_flush(); flush(); ob_start(); // added as per comments below - still not working
    }
?>

Teşekkürler!

0 Cevap