')
{
// do something
}
?
when I tried to use swiitch()
?php
switch (true)
{
case ($result['col_1'] == 'value_1'):
// do something
break;
case ($result['col_2'] == 'value_2'):
// do something
break;
}
?
it will give me
Why do you want to use a switch in this particular instance. You're
comparing apples and oranges (in this case, col_1 and col_2). You use
swithc to evaluate one variable against a number of choice, not multiple
variables against variable choices.
I'm not comparing apples and oranges - just
[EMAIL PROTECTED] wrote:
Why do you want to use a switch in this particular instance. You're
comparing apples and oranges (in this case, col_1 and col_2). You use
swithc to evaluate one variable against a number of choice, not multiple
variables against variable choices.
I'm not