Answer the question
In order to leave comments, you need to log in
How to calculate the value of an expression?
There is an input field in which formulas are entered (note 2*cos($rad)), $rad is calculated in the code, you need to assign the value of this expression to the $r variable. eval("$r=".$func.";"); it doesn't work like that, I don't know how to do it differently. (This value is calculated n times in a loop and $rad is always different, respectively). For personal use only, so the insecurity of eval is not important
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question