in reply to Re: function inline evaluation (formated *gg*)
in thread function inline evaluation (formated *gg*)
This assumes that the variable $i is alrady defined. When $funk is first assigned, $i is resolved to it's value (3 in the example); so $funk actually equals "cos(3)".$funk = "cos($i)";
If you want it dynamic, so that you can change $i and not restuff $funk, you should write it like:
That way you can reassign $i and just eval($funk) again to recompute it's cosine.$funk="cos(\$i)";
|
|---|