NeoMarine Posted January 18, 2010 Share Posted January 18, 2010 $mysqlValue='myfunction($param1value="1",$param2value="2",$param3value="3");'; eval("$mysqlValue"); This works fine... BUT, I want to do: $myfunctionResult = eval("$mysqlValue"); echo $myfunctionResult; ..and it doesn't work?? Link to comment https://forums.phpfreaks.com/topic/188829-getting-the-return-value-of-a-function-executed-through-eval/ Share on other sites More sharing options...
NeoMarine Posted January 18, 2010 Author Share Posted January 18, 2010 Note: If I try using: eval("echo $mysqlValue"); it only echo's the string of the variable and results in echoing to screen: "myfunction($param1value="1",$param2value="2",$param3value="3");" Link to comment https://forums.phpfreaks.com/topic/188829-getting-the-return-value-of-a-function-executed-through-eval/#findComment-996878 Share on other sites More sharing options...
NeoMarine Posted January 18, 2010 Author Share Posted January 18, 2010 nevermind.. I found this code which does it: $strFromDB = "fcall1();"; eval("\$line = " . $strFromDB); echo $line; Link to comment https://forums.phpfreaks.com/topic/188829-getting-the-return-value-of-a-function-executed-through-eval/#findComment-996888 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.