ID:               21428
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: all
 PHP Version:      4.3.0
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

"If you want to read single line from stdin, you can use
<?php
$line = trim(fgets(STDIN)); // reads one line from STDIN
fscanf(STDIN, "%d\n", $number); // reads number from STDIN
?>
"


Previous Comments:
------------------------------------------------------------------------

[2003-01-05 11:48:00] [EMAIL PROTECTED]

Ilia fixed the \r issues in the streams layer itself a while ago, so
this should work on mac.

------------------------------------------------------------------------

[2003-01-05 11:44:08] [EMAIL PROTECTED]

If \r\n was used in the example, would this CLI example work fine on
all OS's including macs? (which uses \r)

------------------------------------------------------------------------

[2003-01-05 07:26:21] [EMAIL PROTECTED]

I completely agree.
fscanf() is for advanced users but one example with fgets() and
fscanf() will be better IMHO.

------------------------------------------------------------------------

[2003-01-05 07:21:27] [EMAIL PROTECTED]

Note: there should be an another one with fgets() IMHO.

------------------------------------------------------------------------

[2003-01-05 07:11:40] [EMAIL PROTECTED]

sorry
STDIN instead of $STDIN

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/21428

-- 
Edit this bug report at http://bugs.php.net/?id=21428&edit=1

Reply via email to