如何将字符串里的变量作为PHP代码命令执行
如题:在A页中<input type="hidden" name="hiddenField" value"$_POST['Self_Fee']+$_POST['Brand_Fee']"/>;
'Self_Fee' 和 'Brand_Fee' 均在A页面中。
B页面实现 将'Self_Fee'与'Brand_Fee'的值累加,可以通过$count = $_POST['Self_Fee']+$_POST['Brand_Fee'];来实现。
小弟在想,如果只知道“hiddenField”,而执行语句写到了value里。我们可以用
<?php
$stmp = $_POST['hiddenField']; //得到了想执行的语句$_POST['Self_Fee']+$_POST['Brand_Fee']
//如何把字符串$stmp中的代码来执行呢?
?>