I try to check a condition using php variable like..
if ($amount. $row['condition']. $row['amount']) {
return true;
} else {
return false;
}
but the condition always return true value ,i also echo the single variable it will show the value and also do dd($amount. $rom['condition']. $rom['amount']); it will show "500>1000" ,i remove the double qutes and manually past value in if condition it will show false with this condition, how to solve and write this condition ?
>Solution :
Use eval()
$condition = $amount. $row['condition']. $row['amount'];
if (eval("return $condition;")) {
return true;
} else {
return false;
}