Cannot output before input
| From: | Chris Lee | Date: | Mon, 18 Aug 2003 04:27:28 +0000 |
| Subject: | Cannot output before input | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-159893@lists.php.net to get a copy of this message | ||
Hi All,
I run the following program at Windows command prompt
c:\php\cli\php.exe input.php
<?php
print "Input:";
flush();
$fp = fopen("php://stdin", "r");
$input = fgets($fp);
fclose($fp);
echo $input;
?>
The program did not show out "Input:" and waiting for input after run!
Any hint to flush the output first?
I am using PHP 4.3.2 (cli) (built: May 28 2003 15:10:38)
Regards,
Chris Lee