note 37682 deleted from function.echo by kennyt
| From: | kennyt@php.net | Date: | Sat, 28 Feb 2004 20:20:33 +0000 |
| Subject: | note 37682 deleted from function.echo by kennyt | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-65950@lists.php.net to get a copy of this message | ||
Note Submitter: TheFatherMind@Dangerous-Minds.NET
----
I have been attempting to write a PHP script for shell. I have been having issues flushing the text
from the buffer...
echo "reading database: ";
$output = exec("mysqldump databasename",$output)
echo "[OK]/n";
Would wait till the script completed before outputting the text rather then printing the first
portion, pausing while reading the database and then printing the "[OK]". So we (dma and
I) that we needed to do an ob_flush(); how ever if there is no newline (/n) then ob_flush() does not
output. For some odd reason the only thing that works is doing an ob_flush(); flush(); so it would
look like this...
echo "reading database: ";ob_flush();flush();
$output = exec("mysqldump databasename",$output)
echo "[OK]/n";ob_flush();
on line 3 only the ob_flush(); is needed because there is a newline at the end.
... Master Merlin Cul Kirkkpatrick / TheFatherMind