I was wondering if it would be possible to do this:
$var = '$something == $somethingelse';
if ($var) { // Say hello }
and have it mean the same thing as this:
if ($something == $somethingelse) { // Say hello }
I know this will not work at the moment, because if ($var) checks to see if $var is set or not. But what I'm asking is: is there a method to allow this? Would appreciate an answer.
EDIT: Basically I feel I should explain why I am doing this. I want users to be able to control when they get a notification, based off some data that one of their "channels" has saved.
For instance, a user only wants to get a notification when their collected data is bigger than 60. So I would get them to choose two fields:
First field input of their number (int or float)
Second field choises (equals, <, >, =<, =>)
The last thing in this if statement would be their data collected by their "channel".
I then want to be able to save their choice in a database, somehow, and then later act upon their choices.
evalfunction in PHP does this: php.net/manual/en/function.eval.phpeval.eval().eval