...

View Full Version : Quick if (or|or|or) question.



iceflyin
08-14-2007, 04:31 AM
Are multiple or statements allowed like this?

It seems it only picks up the first two...



if ($counter == 4|$counter==10|$counter==18){
//dostuff
}

whizard
08-14-2007, 04:40 AM
you need to use
|| not | as the OR operator, AFAIK...

HTH
Dan

CFMaBiSmAd
08-14-2007, 04:43 AM
A single | is a bitwise operator. This is combining the values on either side in binary.

Use a double || for a logical operator to produce a TRUE/FALSE result.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum