How can I complete the folowing ....?
if $x is between these 2 numbers {
$y = 1 }
Using mathmatical operators like "greater than"(>) and "less than"(<) inside an if control structure. Since you're checking two things, you'd need an AND logical operator (&&)
if ($x > $a && $x < $b) { $y = 1; }
That assumes $a is smaller than $b. If you don't know which is smaller, you can use min() and max():
if ($x > min($a, $b) && $x < max($a, $b)) { $y = 1; }
Also, you might want to use >= and <= instead of > and <.
Thank you!