Jump to content

Multiple ors


yeshuawatso

Recommended Posts

Yes.
[code]
if ($a == $b || $c == $d || $e == $f) { echo "an expression returned true" };
[/code]
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]I know my other option is using else ifs,[/quote]
Or's aren't quite the same as else() if() in that they will only ever be able to execute the same code based on a condition.,
Link to comment
Share on other sites

[!--quoteo(post=376620:date=May 24 2006, 11:22 AM:name=Yeshua Watson)--][div class=\'quotetop\']QUOTE(Yeshua Watson @ May 24 2006, 11:22 AM) [snapback]376620[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Ok, this works for different variables, but does the same function work for the same variable?

[code]if($a == $b || $a == $c ||etc.){return true or false or whatever I need it to do here.}[/code]
[/quote]

yes that will work but make sure you get you logic right or you will run into errors
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.