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.

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.