-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

0

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Can't we use without eval ?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.