Reply to Re: STDIN on different OSs

Your name:

Reply:


Posted by Matt on 10/10/08 11:17

"Janwillem Borleffs" <jw@jwscripts.com> wrote in message
news:429b3314$0$52267$dbd4f001@dr4.euro.net...
> 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
>

perfect. Thanks!!

-matt

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация