faqts : Computers : Programming : Languages : PHP : Not Quite PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

16 of 19 people (84%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

If you are using PHP as a standalone scripting tool under NT how can you take keyboard input ?

Mar 28th, 2008 17:41
ha mo, Chris Kings-Lynne, Michael Bicha,


Try opening a file decsriptor to the keyboard as follows:
$fd = fopen('con:', 'r');
or
$fd = fopen('con', 'r');
Then proceed as if it were a normal file.  
I haven't tried this on NT, but going fopen('/dev/stdin', 'r') works 
fine under UNIX...
Chris
http://www.tantofa.com
http://www.fantofa.com
http://www.mantofa.com
http://www.tanpola.com
http://www.tampola.com
http://www.yamot.com
http://www.mozmar.com
http://www.templatestemp.com