Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

php cli



 I'm playing around on the command line with PHP.  Anybody else here do 
that?  Does it work reasonably well for simple scripts.  I'm scratching 
my head on the very first attempt!  Why doesn't this work?  - Eric C. 

#!C:\php\php.exe 
<?php 

/* why doesn't this work on winxp?  it always goes to the default case. 
*/ 

echo "\nHas Eric been drinking?\n"; 
$answer = fread(STDIN, 1024); 
switch ($answer) { 
        case "yes": 
                echo "\nOf course he's been drinking!"; 
                break; 
        case "no": 
                echo "\nYou must be drunk!"; 
                break; 
        default: 
                echo "\nYes or no please."; 
        } 
sleep(2); 

?> 

-- 
This message has been scanned for viruses and 
dangerous content by MailScanner, and is 
believed to be clean. 

_______________________________________________ 
Discuss mailing list 
[hidden email] 
http://lists.blu.org/mailman/listinfo/discuss
 


BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org