Re: Short writage of clauses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 it!";

> 
> I know this is wrong because "2" will always be true ...
> 
> Any infos on that would be nice :)
> 
> Greets
>     Barry

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux