PDA

View Full Version : PHP help



Coda
26-08-2008, 11:54 PM
Right im doing an if statement and what i want it to do is:

if less than 6 but greater than 0 then echo

heres the code so far if someone can tell me what to add to it thanks.


if( $a_pass < 6 )

{

echo "Hello";

}

Moh
27-08-2008, 12:01 AM
So these would work:
1
2
3
4
5


if ( $a_pass < 6 && $a_pass > 0 ) {
echo ("Hello");
}

but if you want
0
6
to also work:


if ( $a_pass <= 6 && $a_pass >= 0 ) {
echo ("Hello");
}

redtom
27-08-2008, 12:06 AM
This should do it;



if ($a_pass < '6' && $a_pass > '0') {

echo ("Hello");

}


Edit: Sorry didn't see the post above when I posted this.

Coda
27-08-2008, 12:08 AM
Thanks :D

Want to hide these adverts? Register an account for free!