> -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
> -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
> us
> -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 if()-elsei
> -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 wha
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 i
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 s
|| $chr == "ê":
$a = str_replace(substr($a,$i,1),"e",$a);
break;
}
- Original Message -
From: "Sean Malloy" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 9:36 PM
Subject: RE: [PHP] Another problem
7;help'): showHelp(); break;
default : 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 sta
ginal Message -
From: "Rick Emery" <[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
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 if()-elseif()-else()
- Original Message -
From: "Beauford.2002" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Its all wrong. You shouldn't be using a switch statement anyway. A switch is
for evaluating a single variable.
alss, your code if ($a && $b == 124) is the equivelent of writing if ($a ==
true && $b == 124).
if ($a == $b)
{
// do struff
}
elseif ( ($a == 124) && ($b == 124) )
{
//do stuff
}
elsei
11 matches
Mail list logo