thepip3r Posted April 21, 2009 Share Posted April 21, 2009 $thc = round(((($_GET['h'] / 25.4) * ($_GET['w'] * .01) * 2) + $_GET['d']), 2); so... $thc ends up being the result of an equation. my question is: Is there some function that will show the EQUATION itself using the variable $thc or do I have duplicate rewrite the equation preformatted to show the equation? so... for example: echo $thc; //gives something like 28.80 //and print_pre($thc); //gives "round(((($_GET['h'] / 25.4) * ($_GET['w'] * .01) * 2) + $_GET['d']), 2)" Link to comment https://forums.phpfreaks.com/topic/155110-variable-returns-result-of-equation-is-there-a-way-to-echo-equation-from-var/ Share on other sites More sharing options...
soak Posted April 21, 2009 Share Posted April 21, 2009 Can't you just echo: <?php echo 'round(((($_GET[\'h\'] / 25.4) * ($_GET[\'w\'] * .01) * 2) + $_GET[\'d\']), 2) = '.$thc; Link to comment https://forums.phpfreaks.com/topic/155110-variable-returns-result-of-equation-is-there-a-way-to-echo-equation-from-var/#findComment-815938 Share on other sites More sharing options...
thepip3r Posted April 21, 2009 Author Share Posted April 21, 2009 i want to echo the equation in a different place than i'm assigning. Link to comment https://forums.phpfreaks.com/topic/155110-variable-returns-result-of-equation-is-there-a-way-to-echo-equation-from-var/#findComment-815943 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.