Bigger tban x, smaller than y (PHP)

How can I do this?

if ($number >1<9) echo 'Number is larger than 1 and smaller than 9.';

Open in new window

LVL 16
hankknightAsked:
Who is Participating?
 
Terry WoodsIT GuruCommented:

if ($number > 1 && $number < 9) echo 'Number is larger than 1 and smaller than 9.';

Open in new window

0
 
agamalCommented:
like this

if ( $number < 9 and $number > 1 ){echo $number;}

Open in new window

0
 
Terry WoodsIT GuruCommented:
Both those will work - see the documentation here, if you like:
http://jp2.php.net/manual/ro/language.operators.logical.php
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.