I have if else condition as string like $cond = '40 < 50 and 60 > 70';
how can I execute it in PHP with out exec.
if ($cond)
not working as it just pass if variable exists or not.
Thank you
Asked
Active
Viewed 43 times
-1

Ibrahim
- 1
- 1
- 1
1 Answers
1
You can use eval()
. But keep in mind that it has its security riscs (see the linked documentation page).

Martin Heralecký
- 5,649
- 3
- 27
- 65
-
Can't we use without eval ? – Ibrahim Sep 27 '20 at 15:54