Cannot output before input
Posted: Sun Aug 17, 2003 11:24 pm
Hi All,
I rrun 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)
I rrun 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)