The following code works
$newfunc = create_function('$a,$b', 'return "ln($a) + ln($b) = " . log($a * $b);');
$a = 2; $b = 3;
echo $newfunc($a, $b) . "\
";
However, I am trying to use a string $x to execute $newfunc but it is not working.
How can I use $x sting in the $newfunc ?
$newfunc = create_function('$a,$b', 'return "ln($a) + ln($b) = " . log($a * $b);');
$x = '2,3';
echo $newfunc($x) . "\
";
Thanks