Get comparison when equality sign is string. PHP. -


this question has answer here:

i have 2 variables:

a = 5; b = " > 6"

how "true" or "false" comparison "5 > 6" using , b? thanks.

you can use php's eval function. highly discourage using , php docs.

the eval() language construct dangerous because allows execution of arbitrary php code. use discouraged. if have verified there no other option use construct, pay special attention not pass user provided data without validating beforehand.


Comments