我正在運行PHP SOAP,循環運行10次。我遇到的問題是,直到循環完成纔會輸出,從而一次顯示每個輸出。
我怎樣才能讓它一次輸出一個,因爲它通過循環進行處理,而不是一次完成整個10個循環後一次完成?一次輸出一個循環而不是一次輸出一個循環?
<?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
}
?>
謝謝!
更新的問題,仍然不工作:( – Dov 2011-01-11 17:09:01