Yes...

switch ($my_variable_to_case) {

        case "value_1":
                php-code-here;
        break;

        case "value_2":
                php-code-here;
        break;

        default:
                php-code-here;
}


It works exactly like c.

-----Original Message-----
From: acleave [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 29, 2001 11:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Case?


I have tried the online documentation and it either errors out on me or
cannot 
find anything when I search on case.  Can someone tell me if PHP supports
case 
statements (or do I just need to do a series of ifs?) and if so where I can 
find them detailed in the online docs?

Thnaks,
Allan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to