manalnor Posted October 25, 2011 Share Posted October 25, 2011 Hello dears, let say i've hits = 10000 and i'm using <? if ($line[hits]==1) { // something } else if($line[hits]==2) { // something else } else { // something else else }?> But i wanna say if $line[hits] is within range 1 to 10 show something else if $line[hits] is within range 11 to 20 show something else how to say it thanks Link to comment https://forums.phpfreaks.com/topic/249801-if-something-is-within-renge/ Share on other sites More sharing options...
Zurev Posted October 25, 2011 Share Posted October 25, 2011 if ($line['hits'] < 10 || $line['hits'] > 1) Less than and greater than are your friends, the double pipe | means OR. http://php.net/manual/en/language.operators.logical.php Link to comment https://forums.phpfreaks.com/topic/249801-if-something-is-within-renge/#findComment-1282194 Share on other sites More sharing options...
Pikachu2000 Posted October 25, 2011 Share Posted October 25, 2011 You would want to use && for that comparison. An OR will return TRUE for any value you give it . . . Link to comment https://forums.phpfreaks.com/topic/249801-if-something-is-within-renge/#findComment-1282196 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.