If I have a variable that has a lot of comma separated numbers.
$var = '594,458,458,458,40,40,488,488,200,40,40,80,120,200,514,5';
And I have two other variables that I want to compare it against
$var_a = "475";
$var_b = "450";
And I want to write the following;
if($var contains a number that is Less than or equal to <= $var_a AND contains a number that is greater than or equal to $var_b) {
$my_new_var = "TRUE";
}
I'm not surre how to write that
It is always echoing "HELLO"
Open in new window