It seems that PHP has his own output buffer by default.
If you want to flush output immediately, you should use flush();
http://us3.php.net/manual/en/function.flush.php
Attention: you should use ob_end_flush() before flush() at first.

ob_implicit_flush() will be also all right.
http://us3.php.net/manual/en/function.ob-implicit-flush.php

Read carefully,especially the comments.

Regards,
Yong

-----Original Message-----
From: Irvin Piraman [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 28, 2005 14:57 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] echo delayed?


Hi all!

I have the following script:

 # date/time stamp
$dt_stamp = date("Ymd.H.i.s");

# the directories
$basedir = str_replace("/","\\",dirname($_SERVER['SCRIPT_FILENAME']));
$shotdir = $basedir."\\sat.shots\\";

echo "downloading satellite snapshots...";

# load the images
$satloc = file_get_contents($basedir."\satloc.txt");
$images = explode("\n",$satloc);

for ( $i=0; $i <= count($images); $i++ )
{
$i_name = trim(basename($images[$i]));
$i_type = trim(strtolower(substr($i_name, -3)));
switch ($i_type) {
case "jpg" :
$img = loadjpeg(trim($images[$i]));
imagejpeg($img,$shotdir.$dt_stamp."-".$i_name);
break;
case "gif" :
$img = loadgif(trim($images[$i]));
imagegif($img,$shotdir.$dt_stamp."-".$i_name);
break;
}
}

echo " done.";

 The script above works perfectly, well almost... 

The problem is that when I run it, I don't see the message "downloading 
satellite snapshots..." that I expect 
to show on the browser before the images are acquired. Instead I get 
"downloading satellite snapshots... done." 
after the script finish execution.

Is this echo delay normal? 

TIA

-- 
Irvin

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to