Barry wrote:
> Jochem Maas schrieb:
>> Barry wrote:
>>> Jochem Maas schrieb:
...
>
> Well i don't want the grandma to be not as old as the table and older
> than the house age and still baking a cookie.
>
> Only if all cases stated are true, i want to bake a cookie :)
then reverse the logic of
Jochem Maas schrieb:
Barry wrote:
Jochem Maas schrieb:
> I find a switch statement sometimes handy for creating a 'truth table'
like you describe (I sometimes find it easier to read and/or add 'if'
clauses):
switch (true) {
case ($grandmaAge >= $tableAge):
case ($grandmaAge < $houseAg
- Original Message -
From: "Stut" <[EMAIL PROTECTED]>
Jochem Maas wrote:
Stut wrote:
But it begs the question why you would want to do this?
it's a handy way to white list data. e.g.
if (in_array($_GET['yourarg'], $allowedValsForYourArg)) echo "nice arg
dude";
(btw: no need t
Stut wrote:
> Jochem Maas wrote:
>> Stut wrote:
>>
>>> But it begs the question why you would want to do this?
>>>
>>
>> it's a handy way to white list data. e.g.
>>
>> if (in_array($_GET['yourarg'], $allowedValsForYourArg)) echo "nice arg
>> dude";
>>
>> (btw: no need to beg ;-)
>>
>
>
Stut schrieb:
Jochem Maas wrote:
Stut wrote:
But it begs the question why you would want to do this?
it's a handy way to white list data. e.g.
if (in_array($_GET['yourarg'], $allowedValsForYourArg)) echo "nice arg
dude";
(btw: no need to beg ;-)
I agree that the in_array funct
Barry wrote:
> Jochem Maas schrieb:
> > I find a switch statement sometimes handy for creating a 'truth table'
>> like you describe (I sometimes find it easier to read and/or add 'if'
>> clauses):
>>
>> switch (true) {
>> case ($grandmaAge >= $tableAge):
>> case ($grandmaAge < $houseAge):
Jochem Maas wrote:
Stut wrote:
But it begs the question why you would want to do this?
it's a handy way to white list data. e.g.
if (in_array($_GET['yourarg'], $allowedValsForYourArg)) echo "nice arg dude";
(btw: no need to beg ;-)
I agree that the in_array function is useful, b
Subject: Re: [PHP] Short writage of clauses
Jochem Maas schrieb:
> I find a switch statement sometimes handy for creating a 'truth table'
> like you describe (I sometimes find it easier to read and/or add 'if'
clauses):
>
> switch (true) {
> case ($gra
Jochem Maas schrieb:
> I find a switch statement sometimes handy for creating a 'truth table'
like you describe (I sometimes find it easier to read and/or add 'if' clauses):
switch (true) {
case ($grandmaAge >= $tableAge):
case ($grandmaAge < $houseAge):
case ($grandmaAg
Stut wrote:
> Barry wrote:
>> Well i do know that you can write IF as ( ? : ) but what i am asking
>> about is something like this:
>>
>> if (a = 1 OR a = 2)
>
> I think you mean == not =.
>
>> is it anyway possible to write it like:
>> if (a = 1 OR 2)
>>
>> I know this is wrong because "2" will
Barry wrote:
> Stut schrieb:
>> Barry wrote:
>>> Well i do know that you can write IF as ( ? : ) but what i am asking
>>> about is something like this:
>>>
>>> if (a = 1 OR a = 2)
>>
>> I think you mean == not =.
> Yeah. sorry ;)
>>
>>> is it anyway possible to write it like:
>>> if (a = 1 OR 2)
>>
Stut schrieb:
Barry wrote:
Well i do know that you can write IF as ( ? : ) but what i am asking
about is something like this:
if (a = 1 OR a = 2)
I think you mean == not =.
Yeah. sorry ;)
is it anyway possible to write it like:
if (a = 1 OR 2)
I know this is wrong because "2" will alway
Barry wrote:
Well i do know that you can write IF as ( ? : ) but what i am asking
about is something like this:
if (a = 1 OR a = 2)
I think you mean == not =.
is it anyway possible to write it like:
if (a = 1 OR 2)
I know this is wrong because "2" will always be true ...
Any infos on that
On 12/06/06, Barry <[EMAIL PROTECTED]> wrote:
Hi everyone!
Well i do know that you can write IF as ( ? : ) but what i am asking
about is something like this:
if (a = 1 OR a = 2)
is it anyway possible to write it like:
if (a = 1 OR 2)
I know this is wrong because "2" will always be true ...
Barry wrote:
> Hi everyone!
>
> Well i do know that you can write IF as ( ? : ) but what i am asking
> about is something like this:
>
> if (a = 1 OR a = 2)
>
> is it anyway possible to write it like:
> if (a = 1 OR 2)
maybe this helps your situation:
if (in_array($a, array(1, 2))) echo "got i
Hi everyone!
Well i do know that you can write IF as ( ? : ) but what i am asking
about is something like this:
if (a = 1 OR a = 2)
is it anyway possible to write it like:
if (a = 1 OR 2)
I know this is wrong because "2" will always be true ...
Any infos on that would be nice :)
Greets
16 matches
Mail list logo