#21428 [Opn->Csd]: additional example for CLI SAPI page

From: Date: Tue, 27 Jul 2004 13:40:36 +0000
Subject: #21428 [Opn->Csd]: additional example for CLI SAPI page
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969362238@lists.php.net to get a copy of this message
ID: 21428 Updated by: vrana@php.net Reported By: andrey@php.net -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] tal@php.net 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] philip@php.net 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] andrey@php.net 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] nicos@php.net Note: there should be an another one with fgets() IMHO. ------------------------------------------------------------------------ [2003-01-05 07:11:40] andrey@php.net 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

« previous php.doc (#969362238) next »