On Friday 20 December 2002 08:28, Sean Malloy wrote:
Its all wrong. You shouldn't be using a switch statement anyway. A switch
is for evaluating a single variable.
You can use the switch construct in the context that the OP was using it. In
fact I prefer use that instead of a whole bunch of
-Original Message-
From: Beauford.2002 [mailto:[EMAIL PROTECTED]]
Sent: 20 December 2002 00:19
This should be as simple as breathing, but not today. I have
two variables
$a and $b which I need to compare in a switch statement in
several different
ways, but no matter what I do
-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 20 December 2002 00:34
switch() does not work that way. Switch uses the value in
the parentheses and selects a
CASE based upon that value. Read the manual.
You will have to use a series of
-Original Message-
From: Sean Malloy [mailto:[EMAIL PROTECTED]]
Sent: 20 December 2002 02:36
To: PHP General
Subject: RE: [PHP] Another problem with conditional statements
Nowhere in the documentation does it specify switch should be
used in the
context you are attempting
-Original Message-
From: Beauford.2002 [mailto:[EMAIL PROTECTED]]
Sent: 20 December 2002 03:15
Using switch would be more efficiant as it would stop once a
match is made
(if you use break), but with eleif statements each one is evaluated in
order.
Not sure that's true -- a
Hi,
This should be as simple as breathing, but not today. I have two variables
$a and $b which I need to compare in a switch statement in several different
ways, but no matter what I do it's wrong.
This is what I have tried, can someone tell me how it should be.
TIA
switch (true):
case
a single variable, otherwise, you are stuck with using is/else
statements
-Original Message-
From: Beauford.2002 [mailto:[EMAIL PROTECTED]]
Sent: Friday, 20 December 2002 11:19 AM
To: PHP General
Subject: [PHP] Another problem with conditional statements
Hi,
This should
: Thursday, December 19, 2002 6:19 PM
Subject: [PHP] Another problem with conditional statements
Hi,
This should be as simple as breathing, but not today. I have two variables
$a and $b which I need to compare in a switch statement in several different
ways, but no matter what I do it's wrong
[EMAIL PROTECTED]
To: Beauford.2002 [EMAIL PROTECTED]; PHP General
[EMAIL PROTECTED]
Sent: Thursday, December 19, 2002 7:33 PM
Subject: Re: [PHP] Another problem with conditional statements
switch() does not work that way. Switch uses the value in the parentheses
and selects a
CASE based upon
: showDefault();
}
-Original Message-
From: Beauford.2002 [mailto:[EMAIL PROTECTED]]
Sent: Friday, 20 December 2002 12:46 PM
To: Rick Emery
Cc: PHP General
Subject: Re: [PHP] Another problem with conditional statements
I believe you are incorrect. Switch will look for the first
: Sean Malloy [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Thursday, December 19, 2002 9:36 PM
Subject: RE: [PHP] Another problem with conditional statements
Nowhere in the documentation does it specify switch should be used in the
context you are attempting.
The docs show a single
On Friday 20 December 2002 08:19, Beauford.2002 wrote:
Hi,
This should be as simple as breathing, but not today. I have two variables
$a and $b which I need to compare in a switch statement in several
different ways, but no matter what I do it's wrong.
This is what I have tried, can someone
12 matches
Mail list logo