Jump to content

help with php operator


karimali831

Recommended Posts

Ok, so this IF statement

 

if(($ds['ratio_low'] || $ds['ratio_high']) && userscoreratio($userID) >= $ds['ratio_low'] && userscoreratio($userID) <= $ds['ratio_low'])

 

Means if $ds['ratio_low'] or $ds['ratio_high'] is not 0 and userscoreratio (23%) is greater or equal to $ds['ratio_low'] (20%) AND userscoreratio (23%) is equal or lesser than $ds['ratio_high'] (30%) ??

 

Thanks for help.

Link to comment
Share on other sites

Something that did not work for me, not sure why:

 

elseif(($ds['ratio_low'] || $ds['ratio_high']) && clanscoreratio($clanID) < $ds['ratio_low'] || clanscoreratio($clanID) > $ds['ratio_high'])

 

I had to use

 

elseif(($ds['ratio_low'] || $ds['ratio_high']) AND clanscoreratio($clanID) < $ds['ratio_low'] || clanscoreratio($clanID) > $ds['ratio_high'])

 

I thought "AND" and "&&" operate exackly the same? why doesn't "&& clanscoreratio..." work and "AND clanscoreratio.." does work?

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.