View Full Version : or in php
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
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.
You might also like to remove the space from between the bars.
|| not | |
Thanks a lot everybody.
Mordred: I needed to know the syntax as you showed me,
Thanks,
Gil
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.