Re: STDIN on different OSs
- From: Janwillem Borleffs <jw@xxxxxxxxxxxxx>
- Date: Mon, 30 May 2005 17:36:52 +0200
Matt wrote:
I'm creating a php script for command line usage. on linux, i must use:
define('STDIN', fopen('php://stdin', 'r'));
to use: fgetc(STDIN)
In windows, however, i must command out the define line to get it to run. Is there an easy way to make this compatible with both operating systems? Is there something i should change w/ my fgetc() command, or can i detect the server's OS and use the define() command accordingly.
Thanks for any suggestions!
-matt
if(!defined("STDIN")) { define("STDIN", fopen('php://stdin','r')); }
JW
.
- Follow-Ups:
- Re: STDIN on different OSs
- From: Matt
- Re: STDIN on different OSs
- References:
- STDIN on different OSs
- From: Matt
- STDIN on different OSs
- Prev by Date: Re: Looking for a good mysql newsgroup (beginner)
- Next by Date: Read/write Excel spread*** libraries
- Previous by thread: STDIN on different OSs
- Next by thread: Re: STDIN on different OSs
- Index(es):