Page 1 of 1

Anyone know how to do this?

Posted: Sat Aug 17, 2002 6:54 am
by DynamiteHost
Any ideas?

I just need to know how to do the "if ($something is between 1 and 10)" part.

===============

Code: Select all

$something = 3;

if ($something is between 1 and 10) {
DO THIS
}
else {
DO THIS
}

Posted: Sat Aug 17, 2002 7:02 am
by hob_goblin

Code: Select all

if ($something >= 1 || $something <= 10) &#123; 
// do this
&#125; 
else &#123; 
// do this
&#125;

Posted: Sat Aug 17, 2002 8:01 am
by llimllib

Code: Select all

if ($something >= 1 && $something <= 10) &#123;
// do this
&#125;
else &#123;
// do this
&#125;
To be technical, you want the && (and) not the || (or) symbol between those.

Posted: Sat Aug 17, 2002 8:32 am
by DynamiteHost
Thanks for the help you two, its appreciated :)

Posted: Sat Aug 17, 2002 4:09 pm
by m3mn0n
very much so! ;)

Posted: Sat Aug 17, 2002 4:46 pm
by hob_goblin
ahh my brain wasnt working that late, i had the right idea though