PDA

View Full Version : or in php


Gil
08-08-2002, 12:46 AM
Hi,

Is there a equivalent to or in php?

Thanks,
Gil

Spookster
08-08-2002, 01:10 AM
Or or || :)


http://www.php.net/manual/en/language.operators.logical.php

Gil
08-08-2002, 09:41 PM
Thanks a lot,

I'm reading. Can you help me for now with the following please:

if ($choise1 == "b" && $choise6 =="1" | | $choise6 =="2" | | $choise6 =="3" && $choise7 =="b" | | $choise7 =="c" | | $choise7 =="d" && $choise8 == "1" && $choise9 == "b")
{
$page = ("1b123bcd1bcd.php");
}

This doesn't work. Can you tell me how to use | | the proper way and make the above code work?

Thanks a lot!

Gil

mordred
08-09-2002, 08:37 AM
You have to tell us what you want to achieve, doesn't work is just a to minimal error description. Although I have a feeling you want to check out parentheses to structure the evaluation order...

if ( ($choise1 == "b" && $choise6 =="1") | | ($choise6 =="2") etc.

Spookster
08-09-2002, 08:40 AM
Yes your order of operations is incorrect. Check out the operator precedence and such at the link I posted.

Ökii
08-09-2002, 10:33 AM
You might also like to remove the space from between the bars.

|| not | |

Gil
08-12-2002, 05:51 PM
Thanks a lot everybody.

Mordred: I needed to know the syntax as you showed me,

Thanks,

Gil