Re: simplify if/then statement
| From: | Jason Wong | Date: | Sat, 27 Apr 2002 18:07:50 +0000 |
| Subject: | Re: simplify if/then statement | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-94928@lists.php.net to get a copy of this message | ||
On Sunday 28 April 2002 02:59, Jim Long wrote:
> Hi,
>
> I've got the following statement for a state options menu.
> How can this be expressed in a simple manner for all 52 states?
>
>
> //choose state
>
> if ($state == "AL") {
>
> // include class
> include("CalcAL.class.inc");
> }
>
> else if ($state == "AR") {
Take a look at the switch construct.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Parsley
is gharsley.
-- Ogden Nash
*/