Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: or in php

  1. #1
    Gil
    Gil is offline
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    or in php

    Hi,

    Is there a equivalent to or in php?

    Thanks,
    Gil

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Gil
    Gil is offline
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #5
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Yes your order of operations is incorrect. Check out the operator precedence and such at the link I posted.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You might also like to remove the space from between the bars.

    || not | |
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.

  • #7
    Gil
    Gil is offline
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a lot everybody.

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

    Thanks,

    Gil


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •