very quick php question...

Soldato
Joined
19 Oct 2002
Posts
3,480
hi peeps need a lightning quick answer to a php question if thats ok...

how do i do a double condition for a php if statement?

i.e. if X and Y then do this...

i thought it was:

if ((number1==1) && (number2==2)) { do this }

but its not...

anyone?
 
JonB said:
if ($number1 == 1 && $number2 == 2) {

do this

}

This is correct, you don't need the () around each different statement.

tbh I prefer using AND and OR as the words in the if statements.

using && but especially || i find makes it harder to read.
 
i was indeed right in the first place, but thanks for the confirmation guys, the reason is wasn't working was the fact i am doing this within actinic and its being a bar steward...
 
Back
Top Bottom