How to find numerical value within range in php

How can I find the let value: 745 is in the range of 0 to 1000 using php?

+3
source share
3 answers
(0 <= $value && $value <= 1000)
+7
source

How about using <=and >=?

$x=745;
$inrange=(0<=$x)&&($x<=1000)
+1
source

Use condition

<?php
$val = 745;
if ($val >= 0 && $val <= 1000)
{
  // Ok
}
else
{
 // Not ok
}
+1
source

Source: https://habr.com/ru/post/1793374/


All Articles