My condition is generated by the code into a string to look like:
$mycondition = "(strpos(strtolower($foo1), strtolower($bar)) !== false) AND (strpos(strtolower($foo1), strtolower($bar2)) !== false) // AND ((strpos(strtolower($foo2), strtolower($bar1)) !== false)) AND..."; ad infinitum My if statement should be like:
if ($mycondition) then... I can do it with eval() like so:
if (eval("return $mycondition;")) then... But I understand eval() is not recommended practice. On searching the forum, I see many voices calling against the use of eval(), but not really many alternatives.
What's the alternative? How do I just place the generated string into the if condition?