I’m trying to remove eval from the following function. I tried with sprintf and ${} , but still cannot find a solution. Here the function: Answer So, yes, eval() is often detested as one of the highest order “evils” in php. In most cases, when a task lends itself to be solved by eval() or variable-variables (which are basically poorly