Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 803
  • Last Modified:

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

0
hankknight
Asked:
hankknight
  • 2
1 Solution
 
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now