If I have:
$compare = "5<6"; How do I look at the compare variable and return the value true. The input needs to be a string so taking away the " won't help. The string could be very complex so I'm looking for a function already in PHP which can run this, or something that someone has written before which can do this. I've tried the eval() function but that doesn't work, so:
$compare = "5<6"; echo eval($compare); just errors. Thanks for your help in advance.
...the passed code must be valid PHP....for eval(): php.net/manual/en/function.eval.phpreturnand;:$compare="5<6";echo eval("return $compare;");evalyou should have read this question: stackoverflow.com/questions/951373/when-is-eval-evil-in-php and at least it's top 3 answers.truewill display1and echoingfalsewill not display anything.