note 37682 added to function.echo
| From: | TheFatherMind at Dangerous-Minds dot NET | Date: | Sun, 23 Nov 2003 04:25:02 +0000 |
| Subject: | note 37682 added to function.echo | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-60850@lists.php.net to get a copy of this message | ||
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
----
Manual Page -- http://www.php.net/manual/en/function.echo.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37682
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37682&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37682&report=yes
Search -- http://master.php.net/manage/user-notes.php