Re: Select case equivelent
| From: | Jon Rosenberg | Date: | Wed, 04 Apr 2001 18:07:55 +0000 |
| Subject: | Re: Select case equivelent | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47110@lists.php.net to get a copy of this message | ||
switch ($i) {
case 0:
print "i equals 0";
break;
case 1:
print "i equals 1";
break;
case 2:
print "i equals 2";
break;
}
----- Original Message -----
From: "Allen May" <umayxa3@donet.com>
To: <php-general@lists.php.net>
Sent: Wednesday, April 04, 2001 2:07 PM
Subject: [PHP] Select case equivelent
> I have a list of conditions I want to test against.
> In ASP, I would do:
>
> Select Case foo
> case "bar1"
> foobar = "fooey"
> case "bar2"
> foobar = "fooey2"
> case "bar3"
> foobar = "fooey3"
> case else
> foobar = "NoBar"
> End Select
>
> How do I do the equivelent in PHP?
>
> Thanks
>
> -Allen
> umayxa3@donet.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>