Robert Granlund
asked on
PHP Variables Great Than Less Than
If I have a variable that has a lot of comma separated numbers.
$var = '594,458,458,458,40,40,488 ,488,200,4 0,40,80,12 0,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
$var = '594,458,458,458,40,40,488
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Never mind my last comment. That works well. Thanks.
ASKER
It is always echoing "HELLO"
Open in new window