Richard Peers Richard Peers - 5 months ago 16x
PHP Question

How to check if an integer is within a range of numbers in PHP?

How can I check if a given number is within a range of numbers?


The expression:

 ($min <= $value) && ($value <= $max)

will be true if $value is between $min and $max, inclusively

See the PHP docs for more on comparison operators