-1

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

Ibrahim
  • 1
  • 1
  • 1

1 Answers1

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