djfox Posted January 7, 2008 Share Posted January 7, 2008 If I want to make an if statement where $value is between $a and $a + 15, how do I make this if statement with an in between? Link to comment https://forums.phpfreaks.com/topic/84944-solved-between-two-values/ Share on other sites More sharing options...
teng84 Posted January 7, 2008 Share Posted January 7, 2008 what????????? Link to comment https://forums.phpfreaks.com/topic/84944-solved-between-two-values/#findComment-433130 Share on other sites More sharing options...
djfox Posted January 8, 2008 Author Share Posted January 8, 2008 In between, as in "choose a number between 5 and 10. Anything below 5 or above 10 does not count." Link to comment https://forums.phpfreaks.com/topic/84944-solved-between-two-values/#findComment-433131 Share on other sites More sharing options...
fert Posted January 8, 2008 Share Posted January 8, 2008 In between, as in "choose a number between 5 and 10. Anything below 5 or above 10 does not count." if($a>5 && $a<10) Link to comment https://forums.phpfreaks.com/topic/84944-solved-between-two-values/#findComment-433133 Share on other sites More sharing options...
djfox Posted January 8, 2008 Author Share Posted January 8, 2008 Thanks! Link to comment https://forums.phpfreaks.com/topic/84944-solved-between-two-values/#findComment-433134 Share on other sites More sharing options...
kratsg Posted January 8, 2008 Share Posted January 8, 2008 <?php if($value >= $a && $value <= $a+15){//if $value is between $a and $a+15 //do something } else { //do something else } ?> Link to comment https://forums.phpfreaks.com/topic/84944-solved-between-two-values/#findComment-433135 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.